diff --git a/include/common/spawn.h b/include/common/spawn.h index 43123269..3f766eff 100644 --- a/include/common/spawn.h +++ b/include/common/spawn.h @@ -2,8 +2,15 @@ #ifndef LABWC_SPAWN_H #define LABWC_SPAWN_H +#include #include +/** + * set_cloexec - set file descriptor to close on exit + * @fd: file descriptor + */ +bool set_cloexec(int fd); + /** * spawn_primary_client - execute asynchronously * @command: command to be executed diff --git a/src/common/spawn.c b/src/common/spawn.c index 898c4800..9468b2b9 100644 --- a/src/common/spawn.c +++ b/src/common/spawn.c @@ -24,7 +24,7 @@ reset_signals_and_limits(void) signal(SIGPIPE, SIG_DFL); } -static bool +bool set_cloexec(int fd) { int flags = fcntl(fd, F_GETFD);