mirror of
https://github.com/libguestfs/libguestfs.git
synced 2026-03-21 22:53:37 +00:00
Use gnulib set_cloexec_flag in a few places.
This commit is contained in:
@@ -29,6 +29,7 @@
|
||||
#include <sys/inotify.h>
|
||||
#endif
|
||||
|
||||
#include "cloexec.h"
|
||||
#include "nonblocking.h"
|
||||
|
||||
#include "guestfs_protocol.h"
|
||||
@@ -120,8 +121,8 @@ do_inotify_init (int max_events)
|
||||
inotify_fd = -1;
|
||||
return -1;
|
||||
}
|
||||
if (fcntl (inotify_fd, F_SETFD, FD_CLOEXEC) == -1) {
|
||||
reply_with_perror ("fcntl: FD_CLOEXEC");
|
||||
if (set_cloexec_flag (inotify_fd, 1) == -1) {
|
||||
reply_with_perror ("set_cloexec_flag");
|
||||
close (inotify_fd);
|
||||
inotify_fd = -1;
|
||||
return -1;
|
||||
|
||||
Reference in New Issue
Block a user