Commit 4ae9bc32 authored by Per Cederqvist's avatar Per Cederqvist

(save_pid, dump_exit_statistics): Use i_fopen and i_fclose instead of

	fopen and fclose.
parent 7d6735ca
/*
* $Id: ramkomd.c,v 0.109 2002/10/27 23:02:47 ceder Exp $
* $Id: ramkomd.c,v 0.110 2002/10/31 09:31:19 ceder Exp $
* Copyright (C) 1991-1999, 2001-2002 Lysator Academic Computer Association.
*
* This file is part of the LysKOM server.
......@@ -114,6 +114,7 @@
#ifdef TRACED_ALLOCATIONS
# include "trace-alloc.h"
#endif
#include "eintr.h"
#if defined(HAVE_SETRLIMIT) && defined(RLIMIT_OFILE) && !defined(RLIMIT_NOFILE)
# define RLIMIT_NOFILE RLIMIT_OFILE
......@@ -277,11 +278,11 @@ save_pid(void)
{
FILE *fp;
if ((fp = fopen(param.pid_name, "w")) == NULL)
if ((fp = i_fopen(param.pid_name, "w")) == NULL)
return;
fprintf(fp, "%ld\n", (long)getpid());
fclose(fp);
i_fclose(fp);
}
static void
......@@ -660,8 +661,8 @@ dump_exit_statistics(void)
FILE *stat_file;
time_t now;
time(&now);
stat_file = fopen(param.memuse_name, "a");
time(&now);
stat_file = i_fopen(param.memuse_name, "a");
if ( stat_file == NULL )
restart_kom("Can't open file to save memory usage to.\n");
......@@ -685,7 +686,7 @@ dump_exit_statistics(void)
dump_allocated_connections(stat_file);
dump_isc_alloc_counts(stat_file);
dump_l2g_stats(stat_file);
fclose (stat_file);
i_fclose (stat_file);
}
static void
......
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