Commit 44d8dbb3 authored by Per Cederqvist's avatar Per Cederqvist
Browse files

(main): Call trace_alloc_file very early during startup if compiled

	with TRACED_ALLOCATIONS.
parent 048b63f3
/*
* $Id: ramkomd.c,v 0.82 1999/05/12 13:25:27 byers Exp $
* $Id: ramkomd.c,v 0.83 1999/05/15 22:55:26 ceder Exp $
* Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996 Lysator Academic Computer Association.
*
* This file is part of the LysKOM server.
......@@ -44,7 +44,7 @@
#endif
static const char *
rcsid = "$Id: ramkomd.c,v 0.82 1999/05/12 13:25:27 byers Exp $";
rcsid = "$Id: ramkomd.c,v 0.83 1999/05/15 22:55:26 ceder Exp $";
#include "rcs.h"
USE(rcsid);
......@@ -107,6 +107,9 @@ USE(rcsid);
#include "unused.h"
#include "sigflags.h"
#include "local-to-global.h"
#ifdef TRACED_ALLOCATIONS
# include "trace-alloc.h"
#endif
#if defined(HAVE_SETRLIMIT) && defined(RLIMIT_OFILE) && !defined(RLIMIT_NOFILE)
# define RLIMIT_NOFILE RLIMIT_OFILE
......@@ -437,6 +440,22 @@ main (int argc,
struct sigaction act;
#endif
#ifdef TRACED_ALLOCATIONS
/* We must do this before we allocate any memory... */
{
char buf[1024];
char *nl;
fputs("Where does the trace want to go today? [stderr]\n", stdout);
fflush(stdout);
if (fgets(buf, sizeof(buf), stdin) != buf)
restart_kom("main(): unable to read trace location\n");
if ((nl = strchr(buf, '\n')) != NULL)
*nl = '\0';
trace_alloc_file(buf);
}
#endif
kom_log("*** Version %s (process %lu) started.\n",
kom_version_info.server_version, (unsigned long)getpid());
#ifdef DEBUG_CALLS
......
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