chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fstab-generator: drop mount_is_bind
[elogind.git]
/
src
/
fstab-generator
/
fstab-generator.c
diff --git
a/src/fstab-generator/fstab-generator.c
b/src/fstab-generator/fstab-generator.c
index 251a346c4d131a2c6ab81d18bd2fac7400d423fd..7b3bf11eda1ff3319bc00b04331f1a33dfc8c88e 100644
(file)
--- a/
src/fstab-generator/fstab-generator.c
+++ b/
src/fstab-generator/fstab-generator.c
@@
-111,7
+111,7
@@
static int add_swap(const char *what, struct mntent *me) {
f = fopen(unit, "wxe");
if (!f) {
r = -errno;
f = fopen(unit, "wxe");
if (!f) {
r = -errno;
- log_error("Failed to create unit file
: %m"
);
+ log_error("Failed to create unit file
%s: %m", unit
);
goto finish;
}
goto finish;
}
@@
-138,7
+138,7
@@
static int add_swap(const char *what, struct mntent *me) {
fflush(f);
if (ferror(f)) {
fflush(f);
if (ferror(f)) {
- log_error("Failed to write unit file
: %m"
);
+ log_error("Failed to write unit file
%s: %m", unit
);
r = -errno;
goto finish;
}
r = -errno;
goto finish;
}
@@
-152,7
+152,7
@@
static int add_swap(const char *what, struct mntent *me) {
mkdir_parents_label(lnk, 0755);
if (symlink(unit, lnk) < 0) {
mkdir_parents_label(lnk, 0755);
if (symlink(unit, lnk) < 0) {
- log_error("Failed to create symlink
: %m"
);
+ log_error("Failed to create symlink
%s: %m", lnk
);
r = -errno;
goto finish;
}
r = -errno;
goto finish;
}
@@
-171,7
+171,7
@@
static int add_swap(const char *what, struct mntent *me) {
mkdir_parents_label(lnk, 0755);
if (symlink(unit, lnk) < 0) {
mkdir_parents_label(lnk, 0755);
if (symlink(unit, lnk) < 0) {
- log_error("Failed to create symlink
: %m"
);
+ log_error("Failed to create symlink
%s: %m", lnk
);
r = -errno;
goto finish;
}
r = -errno;
goto finish;
}
@@
-191,14
+191,6
@@
finish:
return r;
}
return r;
}
-static bool mount_is_bind(struct mntent *me) {
- assert(me);
-
- return
- hasmntopt(me, "bind") ||
- streq(me->mnt_opts, "bind");
-}
-
static bool mount_is_network(struct mntent *me) {
assert(me);
static bool mount_is_network(struct mntent *me) {
assert(me);
@@
-231,7
+223,7
@@
static int add_mount(const char *what, const char *where, struct mntent *me) {
return 0;
isnetwork = mount_is_network(me);
return 0;
isnetwork = mount_is_network(me);
- isbind =
mount_is_bind(me
);
+ isbind =
!!hasmntopt(me, "bind"
);
noauto = !!hasmntopt(me, "noauto");
nofail = !!hasmntopt(me, "nofail");
noauto = !!hasmntopt(me, "noauto");
nofail = !!hasmntopt(me, "nofail");
@@
-262,7
+254,7
@@
static int add_mount(const char *what, const char *where, struct mntent *me) {
f = fopen(unit, "wxe");
if (!f) {
r = -errno;
f = fopen(unit, "wxe");
if (!f) {
r = -errno;
- log_error("Failed to create unit file
: %m"
);
+ log_error("Failed to create unit file
%s: %m", unit
);
goto finish;
}
goto finish;
}
@@
-306,7
+298,7
@@
static int add_mount(const char *what, const char *where, struct mntent *me) {
fflush(f);
if (ferror(f)) {
fflush(f);
if (ferror(f)) {
- log_error("Failed to write unit file
: %m"
);
+ log_error("Failed to write unit file
%s: %m", unit
);
r = -errno;
goto finish;
}
r = -errno;
goto finish;
}
@@
-320,7
+312,7
@@
static int add_mount(const char *what, const char *where, struct mntent *me) {
mkdir_parents_label(lnk, 0755);
if (symlink(unit, lnk) < 0) {
mkdir_parents_label(lnk, 0755);
if (symlink(unit, lnk) < 0) {
- log_error("Failed to create symlink
: %m"
);
+ log_error("Failed to create symlink
%s: %m", lnk
);
r = -errno;
goto finish;
}
r = -errno;
goto finish;
}
@@
-342,7
+334,7
@@
static int add_mount(const char *what, const char *where, struct mntent *me) {
mkdir_parents_label(lnk, 0755);
if (symlink(unit, lnk) < 0) {
mkdir_parents_label(lnk, 0755);
if (symlink(unit, lnk) < 0) {
- log_error("Failed to create symlink
: %m"
);
+ log_error("Failed to create symlink
%s: %m", lnk
);
r = -errno;
goto finish;
}
r = -errno;
goto finish;
}
@@
-367,7
+359,7
@@
static int add_mount(const char *what, const char *where, struct mntent *me) {
f = fopen(automount_unit, "wxe");
if (!f) {
r = -errno;
f = fopen(automount_unit, "wxe");
if (!f) {
r = -errno;
- log_error("Failed to create unit file
: %m"
);
+ log_error("Failed to create unit file
%s: %m", automount_unit
);
goto finish;
}
goto finish;
}
@@
-386,7
+378,7
@@
static int add_mount(const char *what, const char *where, struct mntent *me) {
fflush(f);
if (ferror(f)) {
fflush(f);
if (ferror(f)) {
- log_error("Failed to write unit file
: %m"
);
+ log_error("Failed to write unit file
%s: %m", automount_unit
);
r = -errno;
goto finish;
}
r = -errno;
goto finish;
}
@@
-400,7
+392,7
@@
static int add_mount(const char *what, const char *where, struct mntent *me) {
mkdir_parents_label(lnk, 0755);
if (symlink(automount_unit, lnk) < 0) {
mkdir_parents_label(lnk, 0755);
if (symlink(automount_unit, lnk) < 0) {
- log_error("Failed to create symlink
: %m"
);
+ log_error("Failed to create symlink
%s: %m", lnk
);
r = -errno;
goto finish;
}
r = -errno;
goto finish;
}