tree-wide: always invoke setmntent() with "re" mode
Let's make sure O_CLOEXEC is set for the file descriptor.
This commit is contained in:
parent
08cea7dfc0
commit
9ffcff0e0a
|
@ -310,7 +310,7 @@ static char *disk_mount_point(const char *label) {
|
|||
if (asprintf(&device, "/dev/mapper/%s", label) < 0)
|
||||
return NULL;
|
||||
|
||||
f = setmntent("/etc/fstab", "r");
|
||||
f = setmntent("/etc/fstab", "re");
|
||||
if (!f)
|
||||
return NULL;
|
||||
|
||||
|
|
|
@ -56,7 +56,7 @@ int main(int argc, char *argv[]) {
|
|||
|
||||
umask(0022);
|
||||
|
||||
f = setmntent("/etc/fstab", "r");
|
||||
f = setmntent("/etc/fstab", "re");
|
||||
if (!f) {
|
||||
if (errno == ENOENT) {
|
||||
r = 0;
|
||||
|
|
|
@ -38,7 +38,7 @@ bool fstab_is_mount_point(const char *mount) {
|
|||
_cleanup_endmntent_ FILE *f = NULL;
|
||||
struct mntent *m;
|
||||
|
||||
f = setmntent("/etc/fstab", "r");
|
||||
f = setmntent("/etc/fstab", "re");
|
||||
if (!f)
|
||||
return false;
|
||||
|
||||
|
|
Loading…
Reference in a new issue