[PATCH] Add pid-file support

Jason openconnect at lakedaemon.net
Fri Aug 5 16:27:17 EDT 2011


On Fri, Aug 05, 2011 at 03:57:46PM -0400, Jason wrote:
> Hi Steven,
> 
> On Fri, Aug 05, 2011 at 12:29:31PM -0700, Steven Allen wrote:
...
> > +					fprintf(fp, "%d\n", pid);
> > +					fclose(fp);
> > +				} else {
> > +					fprintf(stderr, "Failed to open '%s' for writing\n", pidfile);
> 
> I would exit fail here.  If the user or a startup script expect a pid
> file to be created, then failing out is appropriate.

Oh, it might be helpful to parse errno here.  Perhaps using strerror()

hth,

Jason.



More information about the openconnect-devel mailing list