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:
Lennart Poettering 2016-12-08 19:36:46 +01:00
parent 08cea7dfc0
commit 9ffcff0e0a
3 changed files with 3 additions and 3 deletions

View file

@ -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;

View file

@ -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;

View file

@ -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;