Commit 93b9b206 authored by Per Cederqvist's avatar Per Cederqvist

(garb_text_file): Use i_rename instead of rename. Check the return value.

parent 97591009
/*
* $Id: dbck.c,v 0.69 2002/09/10 08:48:48 ceder Exp $
* $Id: dbck.c,v 0.70 2002/10/31 09:31:06 ceder Exp $
* Copyright (C) 1991-2002 Lysator Academic Computer Association.
*
* This file is part of the LysKOM server.
......@@ -53,6 +53,7 @@
#endif
#include <assert.h>
#include <setjmp.h>
#include <errno.h>
#include "getopt.h"
#include "misc-types.h"
......@@ -79,6 +80,7 @@
#include "local-to-global.h"
#include "lockdb.h"
#include "linkansi.h"
#include "eintr.h"
#define OPT_PERS_PRESENTATION_CONF 1
......@@ -1317,7 +1319,10 @@ garb_text_file(void)
String text;
kom_log("Renaming %s to %s\n", param.textfile_name, param.textbackupfile_name);
rename(param.textfile_name, param.textbackupfile_name);
if (i_rename(param.textfile_name, param.textbackupfile_name) < 0)
{
restart_kom("rename failed: %s\n", strerror(errno));
}
kom_log("Writing texts to (new) %s\n", param.textfile_name);
fflush(stdout);
fflush(stderr);
......
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