diff options
Diffstat (limited to 'lib/libspl/os/linux/gethostid.c')
-rw-r--r-- | lib/libspl/os/linux/gethostid.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libspl/os/linux/gethostid.c b/lib/libspl/os/linux/gethostid.c index 1eb93f441..457d5bf6f 100644 --- a/lib/libspl/os/linux/gethostid.c +++ b/lib/libspl/os/linux/gethostid.c @@ -45,7 +45,7 @@ get_spl_hostid(void) return (hostid & HOSTID_MASK); } - f = fopen("/sys/module/spl/parameters/spl_hostid", "r"); + f = fopen("/sys/module/spl/parameters/spl_hostid", "re"); if (!f) return (0); @@ -74,7 +74,7 @@ get_system_hostid(void) unsigned long hostid; int hostid_size = 4; /* 4 bytes regardless of arch */ - fd = open("/etc/hostid", O_RDONLY); + fd = open("/etc/hostid", O_RDONLY | O_CLOEXEC); if (fd >= 0) { rc = read(fd, &hostid, hostid_size); if (rc > 0) |