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.