Merge pull request #34781 from poettering/write-string-rename-full
fileio: write_string_file() naming clean-ups
This commit is contained in:
+4
-4
@@ -118,7 +118,7 @@ FILE* fmemopen_unlocked(void *buf, size_t size, const char *mode) {
|
||||
return f;
|
||||
}
|
||||
|
||||
int write_string_stream_ts(
|
||||
int write_string_stream_full(
|
||||
FILE *f,
|
||||
const char *line,
|
||||
WriteStringFileFlags flags,
|
||||
@@ -234,7 +234,7 @@ static int write_string_file_atomic_at(
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
r = write_string_stream_ts(f, line, flags, ts);
|
||||
r = write_string_stream_full(f, line, flags, ts);
|
||||
if (r < 0)
|
||||
goto fail;
|
||||
|
||||
@@ -261,7 +261,7 @@ fail:
|
||||
return r;
|
||||
}
|
||||
|
||||
int write_string_file_ts_at(
|
||||
int write_string_file_full(
|
||||
int dir_fd,
|
||||
const char *fn,
|
||||
const char *line,
|
||||
@@ -314,7 +314,7 @@ int write_string_file_ts_at(
|
||||
if (flags & WRITE_STRING_FILE_DISABLE_BUFFER)
|
||||
setvbuf(f, NULL, _IONBF, 0);
|
||||
|
||||
r = write_string_stream_ts(f, line, flags, ts);
|
||||
r = write_string_stream_full(f, line, flags, ts);
|
||||
if (r < 0)
|
||||
goto fail;
|
||||
|
||||
|
||||
+7
-11
@@ -51,25 +51,21 @@ 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, const struct timespec *ts);
|
||||
int write_string_stream_full(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);
|
||||
return write_string_stream_full(f, line, flags, /* ts= */ NULL);
|
||||
}
|
||||
int write_string_file_ts_at(int dir_fd, const char *fn, const char *line, WriteStringFileFlags flags, const struct timespec *ts);
|
||||
static inline int write_string_file_ts(const char *fn, const char *line, WriteStringFileFlags flags, const struct timespec *ts) {
|
||||
return write_string_file_ts_at(AT_FDCWD, fn, line, flags, ts);
|
||||
int write_string_file_full(int dir_fd, 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_full(AT_FDCWD, fn, line, flags, /* ts= */ NULL);
|
||||
}
|
||||
static inline int write_string_file_at(int dir_fd, const char *fn, const char *line, WriteStringFileFlags flags) {
|
||||
return write_string_file_ts_at(dir_fd, fn, line, flags, NULL);
|
||||
}
|
||||
static inline int write_string_file(const char *fn, const char *line, WriteStringFileFlags flags) {
|
||||
return write_string_file_ts(fn, line, flags, NULL);
|
||||
return write_string_file_full(dir_fd, fn, line, flags, /* ts= */ NULL);
|
||||
}
|
||||
int write_string_filef(const char *fn, WriteStringFileFlags flags, const char *format, ...) _printf_(3, 4);
|
||||
|
||||
int write_base64_file_at(int dir_fd, const char *fn, const struct iovec *data, WriteStringFileFlags flags);
|
||||
|
||||
int write_string_filef(const char *fn, WriteStringFileFlags flags, const char *format, ...) _printf_(3, 4);
|
||||
|
||||
int read_one_line_file_at(int dir_fd, const char *filename, char **ret);
|
||||
static inline int read_one_line_file(const char *filename, char **ret) {
|
||||
return read_one_line_file_at(AT_FDCWD, filename, ret);
|
||||
|
||||
Reference in New Issue
Block a user