Commit dd6dfffc authored by Per Cederqvist's avatar Per Cederqvist
Browse files

(go_daemon): Changed API. Use param.logfile_name instead of trying to

	calculate it from supplied parameters.  All callers updated.
parent c8acf694
/*
* $Id: ramkomd.c,v 0.55 1995/10/07 14:32:06 ceder Exp $
* $Id: ramkomd.c,v 0.56 1995/10/23 07:01:22 ceder Exp $
* Copyright (C) 1991, 1992, 1993, 1994 Lysator Academic Computer Association.
*
* This file is part of the LysKOM server.
......@@ -31,7 +31,7 @@
* It has grown! /ceder
*/
static char *rcsid = "$Id: ramkomd.c,v 0.55 1995/10/07 14:32:06 ceder Exp $";
static char *rcsid = "$Id: ramkomd.c,v 0.56 1995/10/23 07:01:22 ceder Exp $";
#include "rcs.h"
USE(rcsid);
......@@ -235,11 +235,10 @@ save_pid(void)
}
static void
go_daemon(const char *prefix, const char *logf)
go_daemon()
{
pid_t child;
int fd;
char *logfile;
if (buglevel != 0)
{
......@@ -270,20 +269,17 @@ go_daemon(const char *prefix, const char *logf)
setsid();
}
logfile = smalloc(strlen(prefix) + 1 + strlen(logf) + 1);
sprintf(logfile, "%s/%s", prefix, logf);
/* Close all file descriptors */
for (fd = 0; fd < MAX_NO_OF_CONNECTIONS + PROTECTED_FDS; fd++)
close(fd);
if (open("/dev/null", O_RDONLY) != 0
||open("/dev/null", O_WRONLY) != 1
||open(logfile, O_WRONLY|O_CREAT|O_APPEND, 0644) != 2)
||open(param.logfile_name, O_WRONLY|O_CREAT|O_APPEND, 0644) != 2)
{
/* Kinda stupid to try to log an error message now, but
who knows? */
restart_kom("open of log file failed: %d\n", errno);
}
sfree(logfile);
log("*** Version %s (process %d) coming up.\n",
kom_version_info.server_version, getpid());
}
......@@ -359,7 +355,7 @@ initialize(const char *config_file)
# endif
#endif
go_daemon(param.dbase_dir, param.logfile_name);
go_daemon();
server_init(param.ip_client_port, param.ip_mux_port);
init_data_base(param.dbase_dir);
}
......
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