diff options
author | Bruno Haible <bruno@clisp.org> | 2020-05-27 20:02:57 +0200 |
---|---|---|
committer | Bruno Haible <bruno@clisp.org> | 2020-05-28 21:40:08 +0200 |
commit | fb884731c692656b8147b22f9df3cd4f7b7631c0 (patch) | |
tree | ff16d93a5c2fdb68ceb6d4637010269464303bdc /lib/mountlist.c | |
parent | 968988975696de692623bbde066d9048dc02d828 (diff) | |
download | gnulib-fb884731c692656b8147b22f9df3cd4f7b7631c0.tar.gz |
mountlist: Make more robust in multithreaded applications.
* lib/mountlist.c (read_file_system_list): Pass an O_CLOEXEC flag to
open().
* modules/mountlist (Depends-on): Add 'open'.
Diffstat (limited to 'lib/mountlist.c')
-rw-r--r-- | lib/mountlist.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/mountlist.c b/lib/mountlist.c index 4cb19c87f1..9cf78c82e0 100644 --- a/lib/mountlist.c +++ b/lib/mountlist.c @@ -902,7 +902,7 @@ read_file_system_list (bool need_fs_type) # ifndef MNTTAB_LOCK # define MNTTAB_LOCK "/etc/.mnttab.lock" # endif - lockfd = open (MNTTAB_LOCK, O_RDONLY); + lockfd = open (MNTTAB_LOCK, O_RDONLY | O_CLOEXEC); if (0 <= lockfd) { struct flock flock; |