ircd: ircd main: use librb functions for daemon management

This commit is contained in:
William Pitcock 2016-03-20 02:03:32 -05:00
parent a7fb269357
commit 538d208948

View file

@ -220,6 +220,7 @@ init_sys(void)
static int static int
make_daemon(void) make_daemon(void)
{ {
#ifndef _WIN32
int pid; int pid;
int pip[2]; int pip[2];
char c; char c;
@ -254,7 +255,7 @@ make_daemon(void)
/* fclose(stdin); /* fclose(stdin);
fclose(stdout); fclose(stdout);
fclose(stderr); */ fclose(stderr); */
#endif
return 0; return 0;
} }
@ -420,7 +421,7 @@ check_pidfile(const char *filename)
if(fgets(buff, 20, fb) != NULL) if(fgets(buff, 20, fb) != NULL)
{ {
pidfromfile = atoi(buff); pidfromfile = atoi(buff);
if(!kill(pidfromfile, 0)) if(!rb_kill(pidfromfile, 0))
{ {
printf("ircd: daemon is already running\n"); printf("ircd: daemon is already running\n");
exit(-1); exit(-1);