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;
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)))
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;
}