FILE *f,
const char *line,
WriteStringFileFlags flags,
- struct timespec *ts) {
+ const struct timespec *ts) {
bool needs_nl;
int r, fd;
return r;
if (ts) {
- struct timespec twice[2] = {*ts, *ts};
+ const struct timespec twice[2] = {*ts, *ts};
if (futimens(fd, twice) < 0)
return -errno;
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;
const char *fn,
const char *line,
WriteStringFileFlags flags,
- struct timespec *ts) {
+ const struct timespec *ts) {
_cleanup_fclose_ FILE *f = NULL;
int q, r, fd;
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);
}