avoid inclusion of setup.h in util.h

This commit is contained in:
Yang Tse 2008-02-28 09:38:32 +00:00
Родитель ed63d9d4de
Коммит 3d74649908
2 изменённых файлов: 4 добавлений и 5 удалений

Просмотреть файл

@ -218,7 +218,7 @@ int wait_ms(int timeout_ms)
return r; return r;
} }
bool write_pidfile(const char *filename) int write_pidfile(const char *filename)
{ {
FILE *pidfile; FILE *pidfile;
long pid; long pid;
@ -227,10 +227,10 @@ bool write_pidfile(const char *filename)
pidfile = fopen(filename, "w"); pidfile = fopen(filename, "w");
if(!pidfile) { if(!pidfile) {
logmsg("Couldn't write pid file: %s %s", filename, strerror(ERRNO)); logmsg("Couldn't write pid file: %s %s", filename, strerror(ERRNO));
return FALSE; return 0; /* fail */
} }
fprintf(pidfile, "%ld\n", pid); fprintf(pidfile, "%ld\n", pid);
fclose(pidfile); fclose(pidfile);
logmsg("Wrote pid %ld to %s", pid, filename); logmsg("Wrote pid %ld to %s", pid, filename);
return TRUE; return 1; /* success */
} }

Просмотреть файл

@ -22,7 +22,6 @@
* *
* $Id$ * $Id$
***************************************************************************/ ***************************************************************************/
#include "setup.h" /* portability help from the lib directory */
void logmsg(const char *msg, ...); void logmsg(const char *msg, ...);
@ -52,6 +51,6 @@ char *test2file(long testno);
int wait_ms(int timeout_ms); int wait_ms(int timeout_ms);
bool write_pidfile(const char *filename); int write_pidfile(const char *filename);
#endif /* __SERVER_UTIL_H */ #endif /* __SERVER_UTIL_H */