mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-01-11 05:17:44 +03:00
fstab-generator: line break a bit more systematically
This commit is contained in:
parent
56a061f508
commit
33a4c98342
@ -174,8 +174,13 @@ static bool mount_in_initrd(struct mntent *me) {
|
||||
streq(me->mnt_dir, "/usr");
|
||||
}
|
||||
|
||||
static int write_timeout(FILE *f, const char *where, const char *opts,
|
||||
const char *filter, const char *variable) {
|
||||
static int write_timeout(
|
||||
FILE *f,
|
||||
const char *where,
|
||||
const char *opts,
|
||||
const char *filter,
|
||||
const char *variable) {
|
||||
|
||||
_cleanup_free_ char *timeout = NULL;
|
||||
char timespan[FORMAT_TIMESPAN_MAX];
|
||||
usec_t u;
|
||||
@ -208,8 +213,12 @@ static int write_mount_timeout(FILE *f, const char *where, const char *opts) {
|
||||
"x-systemd.mount-timeout\0", "TimeoutSec");
|
||||
}
|
||||
|
||||
static int write_dependency(FILE *f, const char *opts,
|
||||
const char *filter, const char *format) {
|
||||
static int write_dependency(
|
||||
FILE *f,
|
||||
const char *opts,
|
||||
const char *filter,
|
||||
const char *format) {
|
||||
|
||||
_cleanup_strv_free_ char **names = NULL, **units = NULL;
|
||||
_cleanup_free_ char *res = NULL;
|
||||
char **s;
|
||||
@ -230,6 +239,7 @@ static int write_dependency(FILE *f, const char *opts,
|
||||
r = unit_name_mangle_with_suffix(*s, "as dependency", 0, ".mount", &x);
|
||||
if (r < 0)
|
||||
return log_error_errno(r, "Failed to generate unit name: %m");
|
||||
|
||||
r = strv_consume(&units, x);
|
||||
if (r < 0)
|
||||
return log_oom();
|
||||
@ -249,7 +259,8 @@ static int write_dependency(FILE *f, const char *opts,
|
||||
}
|
||||
|
||||
static int write_after(FILE *f, const char *opts) {
|
||||
return write_dependency(f, opts, "x-systemd.after", "After=%1$s\n");
|
||||
return write_dependency(f, opts,
|
||||
"x-systemd.after", "After=%1$s\n");
|
||||
}
|
||||
|
||||
static int write_requires_after(FILE *f, const char *opts) {
|
||||
|
Loading…
Reference in New Issue
Block a user