Test harness process control enhancements

This commit is contained in:
Yang Tse 2009-12-16 15:16:06 +00:00
parent 3111701c38
commit 3802d027cd
4 changed files with 166 additions and 93 deletions

View file

@ -86,7 +86,7 @@ void logmsg(const char *msg, ...)
vsnprintf(buffer, sizeof(buffer), msg, ap);
va_end(ap);
logfp = fopen(serverlogfile, "a");
logfp = fopen(serverlogfile, "ab");
if(logfp) {
fprintf(logfp, "%s %s\n", timebuf, buffer);
fclose(logfp);
@ -221,7 +221,7 @@ int write_pidfile(const char *filename)
long pid;
pid = (long)getpid();
pidfile = fopen(filename, "w");
pidfile = fopen(filename, "wb");
if(!pidfile) {
logmsg("Couldn't write pid file: %s %s", filename, strerror(ERRNO));
return 0; /* fail */