Commit 93cf293d authored by Per Cederqvist's avatar Per Cederqvist
Browse files

Alternative implementation of restart_kom unless HAVE_VFPRINTF.

parent cf2f81c3
/* /*
* $Id: ramkomd.c,v 0.38 1993/10/13 00:10:32 ceder Exp $ * $Id: ramkomd.c,v 0.39 1993/10/13 18:14:05 ceder Exp $
* Copyright (C) 1991 Lysator Academic Computer Association. * Copyright (C) 1991 Lysator Academic Computer Association.
* *
* This file is part of the LysKOM server. * This file is part of the LysKOM server.
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
* It has grown! /ceder * It has grown! /ceder
*/ */
static char *rcsid = "$Id: ramkomd.c,v 0.38 1993/10/13 00:10:32 ceder Exp $"; static char *rcsid = "$Id: ramkomd.c,v 0.39 1993/10/13 18:14:05 ceder Exp $";
#include "rcs.h" #include "rcs.h"
USE(rcsid); USE(rcsid);
...@@ -267,7 +267,7 @@ save_pid(void) ...@@ -267,7 +267,7 @@ save_pid(void)
if ( (fp = fopen(pidfile, "w")) == NULL ) if ( (fp = fopen(pidfile, "w")) == NULL )
return; return;
fprintf(fp, "%d", getpid()); fprintf(fp, "%d\n", getpid());
fclose(fp); fclose(fp);
} }
...@@ -424,10 +424,18 @@ dump_exit_statistics(void) ...@@ -424,10 +424,18 @@ dump_exit_statistics(void)
} }
void void
#ifdef HAVE_VFPRINTF
restart_kom(const char * format, ...) restart_kom(const char * format, ...)
#else
restart_kom(format,
a, b, c, d, e, f, g)
const char *format;
int a, b, c, d, e, f, g;
#endif
{ {
#ifdef HAVE_VFPRINTF
va_list AP; va_list AP;
#endif
#if defined(HAVE_GETCWD) #if defined(HAVE_GETCWD)
char pathname[1026]; char pathname[1026];
#else /* !defined(HAVE_GETCWD) */ #else /* !defined(HAVE_GETCWD) */
...@@ -439,11 +447,16 @@ restart_kom(const char * format, ...) ...@@ -439,11 +447,16 @@ restart_kom(const char * format, ...)
# endif /* !defined(MAXPATHLEN) */ # endif /* !defined(MAXPATHLEN) */
#endif /* !defined(HAVE_GETCWD) */ #endif /* !defined(HAVE_GETCWD) */
#ifdef HAVE_VFPRINTF
va_start(AP, format); va_start(AP, format);
logv(format, AP); logv(format, AP);
va_end(AP); va_end(AP);
#else
log(format, a, b, c, d, e, f, g);
#endif
log("Previous message is fatal. Will dump core now.\n"); log("Previous message is fatal. Will dump core now.\n");
#ifdef HAVE_GETCWD #ifdef HAVE_GETCWD
/* getcwd is POSIX, so try that first. */ /* getcwd is POSIX, so try that first. */
if (getcwd(pathname, 1026) == NULL) if (getcwd(pathname, 1026) == NULL)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment