Commit 87b6f091 authored by Per Cederqvist's avatar Per Cederqvist

(dump_statistics): Use i_fopen and i_fclose instead of fopen and fclose.

(dump_connections): Ditto, and i_rename instead of rename.
parent 6149e13a
/*
* $Id: connections.c,v 0.87 2002/10/28 17:34:01 ceder Exp $
* $Id: connections.c,v 0.88 2002/10/31 09:30:43 ceder Exp $
* Copyright (C) 1991-2002 Lysator Academic Computer Association.
*
* This file is part of the LysKOM server.
......@@ -85,6 +85,7 @@
#include "sigflags.h"
#include "server-time.h"
#include "aux-items.h"
#include "eintr.h"
IscMaster * kom_server_mcb = NULL;
Connection * active_connection = NULL;
......@@ -477,7 +478,7 @@ dump_statistics(void)
int i;
FILE *fp;
if ((fp = fopen(param.statistic_name, "a")) == NULL)
if ((fp = i_fopen(param.statistic_name, "a")) == NULL)
{
kom_log("dump_statistics(): can't open file %s\n",
param.statistic_name);
......@@ -504,7 +505,7 @@ dump_statistics(void)
}
fprintf(fp, "\n");
fclose(fp);
i_fclose(fp);
last_dump = current_time;
}
......@@ -553,7 +554,7 @@ dump_connections(void)
Connection *conn;
FILE *fp;
if ((fp = fopen(param.connection_status_file_tmp, "w")) == NULL)
if ((fp = i_fopen(param.connection_status_file_tmp, "w")) == NULL)
{
kom_log("dump_connections(): can't open file %s: %s\n",
param.connection_status_file_tmp, strerror(errno));
......@@ -573,15 +574,15 @@ dump_connections(void)
if (ferror(fp))
kom_log("dump_connections(): ferror() says an error has occured.\n");
if (fclose(fp) < 0)
if (i_fclose(fp) < 0)
{
kom_log("dump_connections(): fclose failed: %s (ignored)\n",
strerror(errno));
}
errno = 0;
if (rename(param.connection_status_file_tmp,
param.connection_status_file) < 0)
if (i_rename(param.connection_status_file_tmp,
param.connection_status_file) < 0)
{
kom_log("dump_connections(): can't rename %s to %s: %s\n",
param.connection_status_file_tmp,
......
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