[JDEV] initial patches for dealing with SIGHUP better.

Phillip Oleson poleson at verio.net
Tue Feb 20 18:16:25 CST 2001


Here are my initial patches to make jabberd deal with SIGHUP better.
The dnsrv coprocess still gets fubar'd along the way, but I don't
have my brain around dnsrv's co-process/thread layout yet.

	Phil.


Index: jabberd/config.c
===================================================================
RCS file: /home/cvs/jabberd/config.c,v
retrieving revision 1.30
diff -r1.30 config.c
160a161,187
> /*
>  * unlinks the file specified in config at:
>  * <pidfile>/path/to/pid.file</pidfile>
>  *
>  * returns true if it did anything.
>  */
> int remove_pid(void)
> {
>     xmlnode pidfile;
>     char *pidpath = '\0';
>
>     if(greymatter__ == NULL)
>       return 0;
>
>     /* Get rid of our pid file */
>     pidfile = xmlnode_get_tag(greymatter__, "pidfile");
>     if(pidfile != NULL)
>     {
>         pidpath = xmlnode_get_data(pidfile);
>         if(pidpath != NULL)
>         unlink(pidpath); /* should we check for success?? */
>
>       return 1;
>     }
>     return 0;
> }
>
163c190
<     char def[] = "jabber.xml";
---
>     char def[] = "/usr/local/jabber/conf/jabber.xml";
Index: jabberd/jabberd.c
===================================================================
RCS file: /home/cvs/jabberd/jabberd.c,v
retrieving revision 1.28
diff -r1.28 jabberd.c
47a48
> int remove_pid(void);
66,67d66
<     xmlnode pidfile;
<     char *pidpath;
205a205
>       remove_pid();
331,338c331
<     /* Get rid of our pid file */
<     pidfile = xmlnode_get_tag(greymatter__, "pidfile");
<     if(pidfile != NULL)
<     {
<         pidpath = xmlnode_get_data(pidfile);
<         if(pidpath != NULL)
<             unlink(pidpath);
<     }
---
>     remove_pid();
348a342
>                                                                                                                          



-- 
Mourn the passing of the Mystic Knights.. but revel in their legacy.




More information about the JDev mailing list