[Xastir] Strange question....
Dan Brown
brown at brauhaus.org
Mon Mar 7 12:16:23 EST 2005
On Mon, 7 Mar 2005, Curt, WE7U wrote:
> On Mon, 7 Mar 2005, Dan Brown wrote:
>
> > + /* Save our PID */
> > +
> > + FILE * MYPID ;
> > +
> > + MYPID = fopen(get_user_base_dir("xastir.pid"),"w");
> > + fprintf(MYPID, "%d",getpid());
> > + fclose (MYPID);
> > +
>
> > (prolly need to add some code to remove the .pid file, at some point, too,
> > maybe after coffee...)
>
> A PID file briefly crossed my mind while I was answering the
> question (as in it sure would have been easier if we had one!).
> Having a PID file would be useful during debugging too, when it
> hangs but doesn't die.
>
> For that matter, if we have a PID file we can detect when we have
> another Xastir running and switch our config files to an alternate
> set, or refuse to bring up the second copy, etc.
Well, that code should do what you need to do - save for removing it at the
end. I just hadn't had enough (any) coffee, so one round of source code
diving was all for me this morning ;-)
--
Dan Brown
brown at brauhausdc.org
More information about the Xastir
mailing list