mirror of
https://github.com/AuxXxilium/eudev.git
synced 2024-12-28 06:35:34 +07:00
mount: don't fail if fstab doesn't exist
This commit is contained in:
parent
59e132a7f4
commit
e0295d2651
@ -1537,8 +1537,9 @@ static int mount_load_etc_fstab(Manager *m) {
|
||||
assert(m);
|
||||
|
||||
errno = 0;
|
||||
if (!(f = setmntent("/etc/fstab", "r")))
|
||||
return -errno;
|
||||
f = setmntent("/etc/fstab", "r");
|
||||
if (!f)
|
||||
return errno == ENOENT ? 0 : -errno;
|
||||
|
||||
while ((me = getmntent(f))) {
|
||||
char *where, *what;
|
||||
|
@ -190,7 +190,8 @@ static char *disk_mount_point(const char *label) {
|
||||
if (asprintf(&device, "/dev/mapper/%s", label) < 0)
|
||||
goto finish;
|
||||
|
||||
if (!(f = setmntent("/etc/fstab", "r")))
|
||||
f = setmntent("/etc/fstab", "r");
|
||||
if (!f)
|
||||
goto finish;
|
||||
|
||||
while ((m = getmntent(f)))
|
||||
|
@ -56,6 +56,11 @@ int main(int argc, char *argv[]) {
|
||||
|
||||
f = setmntent("/etc/fstab", "r");
|
||||
if (!f) {
|
||||
if (errno == ENOENT) {
|
||||
ret = EXIT_SUCCESS;
|
||||
goto finish;
|
||||
}
|
||||
|
||||
log_error("Failed to open /etc/fstab: %m");
|
||||
goto finish;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user