mirror of
https://github.com/labwc/labwc.git
synced 2026-04-07 08:21:20 -04:00
allow to reuse set_cloexec
This commit is contained in:
parent
68c826e082
commit
6d8afd36fa
2 changed files with 8 additions and 1 deletions
|
|
@ -2,8 +2,15 @@
|
||||||
#ifndef LABWC_SPAWN_H
|
#ifndef LABWC_SPAWN_H
|
||||||
#define LABWC_SPAWN_H
|
#define LABWC_SPAWN_H
|
||||||
|
|
||||||
|
#include <stdbool.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* set_cloexec - set file descriptor to close on exit
|
||||||
|
* @fd: file descriptor
|
||||||
|
*/
|
||||||
|
bool set_cloexec(int fd);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* spawn_primary_client - execute asynchronously
|
* spawn_primary_client - execute asynchronously
|
||||||
* @command: command to be executed
|
* @command: command to be executed
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ reset_signals_and_limits(void)
|
||||||
signal(SIGPIPE, SIG_DFL);
|
signal(SIGPIPE, SIG_DFL);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool
|
bool
|
||||||
set_cloexec(int fd)
|
set_cloexec(int fd)
|
||||||
{
|
{
|
||||||
int flags = fcntl(fd, F_GETFD);
|
int flags = fcntl(fd, F_GETFD);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue