diff options
Diffstat (limited to 'hurd/hurdmsg.c')
-rw-r--r-- | hurd/hurdmsg.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/hurd/hurdmsg.c b/hurd/hurdmsg.c index 896fb87..8fde1f5 100644 --- a/hurd/hurdmsg.c +++ b/hurd/hurdmsg.c @@ -323,7 +323,13 @@ _S_msg_set_fd (mach_port_t msgport, mach_port_t auth, AUTHCHECK; /* We consume the reference if successful. */ - err = HURD_FD_USE (which, (_hurd_port2fd (descriptor, port, 0), 0)); + err = HURD_FD_USE (which, + ({ + int flags = (descriptor->flags & FD_CLOEXEC) + ? O_CLOEXEC : 0; + _hurd_port2fd (descriptor, port, flags); + 0; + })); if (err) return err; |