mirror of
https://github.com/NikitaIvanovV/ctpv.git
synced 2024-11-24 13:53:07 +01:00
Fix: __sighandler_t is not portable
This commit is contained in:
parent
526dc2642f
commit
37b1549f79
@ -34,12 +34,6 @@ static void sig_handler_exit(int s)
|
||||
do_exit = 1;
|
||||
}
|
||||
|
||||
static int register_signal(int sig, __sighandler_t handler)
|
||||
{
|
||||
ERRCHK_RET_ERN(signal(sig, handler) == SIG_ERR);
|
||||
return OK;
|
||||
}
|
||||
|
||||
static int open_fifo(int *fd, char *f)
|
||||
{
|
||||
ERRCHK_RET_ERN((*fd = open(f, O_RDONLY | O_NONBLOCK)) == -1);
|
||||
|
@ -159,3 +159,9 @@ const char *get_ext(const char *path)
|
||||
|
||||
return dot;
|
||||
}
|
||||
|
||||
int register_signal(int sig, SigHandler handler)
|
||||
{
|
||||
ERRCHK_RET_ERN(signal(sig, handler) == SIG_ERR);
|
||||
return OK;
|
||||
}
|
||||
|
@ -23,6 +23,8 @@
|
||||
|
||||
typedef int (*SpawnProg)(const void *);
|
||||
|
||||
typedef void (*SigHandler)(int);
|
||||
|
||||
extern char *program;
|
||||
|
||||
int spawn_redirect(const void *arg);
|
||||
@ -39,4 +41,6 @@ int get_config_dir(char *buf, size_t len, char *name);
|
||||
int mkpath(char* file_path, int mode);
|
||||
const char *get_ext(const char *path);
|
||||
|
||||
int register_signal(int sig, SigHandler handler);
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user