Files
mosh/third/libstddjb/coe.c
T
Quentin Smith 77f3a9073f Import selfpipe code from skalibs 1.2.5
[andersk@mit.edu: Move code to new third/libstddjb directory]
2012-03-07 03:05:37 -05:00

12 lines
211 B
C

/* ISC license. */
#include <fcntl.h>
#include "djbunix.h"
int coe (int fd)
{
register int flags = fcntl(fd, F_GETFD, 0) ;
if (flags < 0) return -1 ;
return fcntl(fd, F_SETFD, flags | FD_CLOEXEC) ;
}