mirror of
https://github.com/systemd/systemd.git
synced 2026-08-06 16:10:59 +00:00
basic/fileio: constify struct timespec arguments
This commit is contained in:
@@ -117,7 +117,7 @@ int write_string_stream_ts(
|
||||
FILE *f,
|
||||
const char *line,
|
||||
WriteStringFileFlags flags,
|
||||
struct timespec *ts) {
|
||||
const struct timespec *ts) {
|
||||
|
||||
bool needs_nl;
|
||||
int r, fd;
|
||||
@@ -161,7 +161,7 @@ int write_string_stream_ts(
|
||||
return r;
|
||||
|
||||
if (ts) {
|
||||
struct timespec twice[2] = {*ts, *ts};
|
||||
const struct timespec twice[2] = {*ts, *ts};
|
||||
|
||||
if (futimens(fd, twice) < 0)
|
||||
return -errno;
|
||||
@@ -174,7 +174,7 @@ static int write_string_file_atomic(
|
||||
const char *fn,
|
||||
const char *line,
|
||||
WriteStringFileFlags flags,
|
||||
struct timespec *ts) {
|
||||
const struct timespec *ts) {
|
||||
|
||||
_cleanup_fclose_ FILE *f = NULL;
|
||||
_cleanup_free_ char *p = NULL;
|
||||
@@ -221,7 +221,7 @@ int write_string_file_ts(
|
||||
const char *fn,
|
||||
const char *line,
|
||||
WriteStringFileFlags flags,
|
||||
struct timespec *ts) {
|
||||
const struct timespec *ts) {
|
||||
|
||||
_cleanup_fclose_ FILE *f = NULL;
|
||||
int q, r, fd;
|
||||
|
||||
@@ -48,11 +48,11 @@ DIR* take_fdopendir(int *dfd);
|
||||
FILE* open_memstream_unlocked(char **ptr, size_t *sizeloc);
|
||||
FILE* fmemopen_unlocked(void *buf, size_t size, const char *mode);
|
||||
|
||||
int write_string_stream_ts(FILE *f, const char *line, WriteStringFileFlags flags, struct timespec *ts);
|
||||
int write_string_stream_ts(FILE *f, const char *line, WriteStringFileFlags flags, const struct timespec *ts);
|
||||
static inline int write_string_stream(FILE *f, const char *line, WriteStringFileFlags flags) {
|
||||
return write_string_stream_ts(f, line, flags, NULL);
|
||||
}
|
||||
int write_string_file_ts(const char *fn, const char *line, WriteStringFileFlags flags, struct timespec *ts);
|
||||
int write_string_file_ts(const char *fn, const char *line, WriteStringFileFlags flags, const struct timespec *ts);
|
||||
static inline int write_string_file(const char *fn, const char *line, WriteStringFileFlags flags) {
|
||||
return write_string_file_ts(fn, line, flags, NULL);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user