1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-01 09:21:26 +03:00

fileio: document why fileio-label.c and fileio.c are two different modules

This commit is contained in:
Lennart Poettering 2017-11-27 16:06:39 +01:00
parent 91d2f19594
commit 7d7a99ac9f
2 changed files with 13 additions and 4 deletions

View File

@ -25,6 +25,10 @@
#include "fileio.h"
/* These functions are split out of fileio.h (and not for examplement just as flags to the functions they wrap) in
* order to optimize linking: This way, -lselinux is needed only for the callers of these functions that need selinux,
* but not for all */
int write_string_file_atomic_label_ts(const char *fn, const char *line, struct timespec *ts);
static inline int write_string_file_atomic_label(const char *fn, const char *line) {
return write_string_file_atomic_label_ts(fn, line, NULL);

View File

@ -30,11 +30,16 @@
#include "time-util.h"
typedef enum {
WRITE_STRING_FILE_CREATE = 1<<0,
WRITE_STRING_FILE_ATOMIC = 1<<1,
WRITE_STRING_FILE_AVOID_NEWLINE = 1<<2,
WRITE_STRING_FILE_CREATE = 1<<0,
WRITE_STRING_FILE_ATOMIC = 1<<1,
WRITE_STRING_FILE_AVOID_NEWLINE = 1<<2,
WRITE_STRING_FILE_VERIFY_ON_FAILURE = 1<<3,
WRITE_STRING_FILE_SYNC = 1<<4,
WRITE_STRING_FILE_SYNC = 1<<4,
/* And before you wonder, why write_string_file_atomic_label_ts() is a separate function instead of just one
more flag here: it's about linking: we don't want to pull -lselinux into all users of write_string_file()
and friends. */
} WriteStringFileFlags;
int write_string_stream_ts(FILE *f, const char *line, WriteStringFileFlags flags, struct timespec *ts);