[PATCH] Add pid-file support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.



[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux