Lines Matching refs:fn
62 static int write_string_file_atomic(const char *fn, const char *line, bool enforce_newline) {
67 assert(fn);
70 r = fopen_temporary(fn, &f, &p);
78 if (rename(p, fn) < 0)
88 int write_string_file(const char *fn, const char *line, WriteStringFileFlags flags) {
92 assert(fn);
98 r = write_string_file_atomic(fn, line, !(flags & WRITE_STRING_FILE_AVOID_NEWLINE));
106 f = fopen(fn, "we");
116 fd = open(fn, O_WRONLY|O_CLOEXEC|O_NOCTTY);
145 q = verify_file(fn, line, !(flags & WRITE_STRING_FILE_AVOID_NEWLINE));
152 int read_one_line_file(const char *fn, char **line) {
156 assert(fn);
159 f = fopen(fn, "re");
180 int verify_file(const char *fn, const char *blob, bool accept_extra_nl) {
185 assert(fn);
197 f = fopen(fn, "re");
280 int read_full_file(const char *fn, char **contents, size_t *size) {
283 assert(fn);
286 f = fopen(fn, "re");
1111 const char *fn;
1125 fn = basename(p);
1126 if (!filename_is_valid(fn))
1136 strcpy(stpcpy(stpcpy(stpcpy(mempcpy(t, p, fn - p), ".#"), extra), fn), "XXXXXX");
1143 const char *fn;
1159 fn = basename(p);
1160 if (!filename_is_valid(fn))
1170 x = stpcpy(stpcpy(stpcpy(mempcpy(t, p, fn - p), ".#"), extra), fn);
1219 int write_timestamp_file_atomic(const char *fn, usec_t n) {
1230 return write_string_file(fn, ln, WRITE_STRING_FILE_CREATE|WRITE_STRING_FILE_ATOMIC);
1233 int read_timestamp_file(const char *fn, usec_t *ret) {
1238 r = read_one_line_file(fn, &ln);