From 04c5fd91e855b09a22bd5a97ffa67325185e9745 Mon Sep 17 00:00:00 2001 From: Henning Brauer Date: Tue, 1 Feb 2005 16:04:16 +0000 Subject: make fbackupfile() return FALSE when the rename(2) from the mkstemp()-derived name to the filename~ one fails From: Han Boetes --- usr.bin/mg/fileio.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'usr.bin') diff --git a/usr.bin/mg/fileio.c b/usr.bin/mg/fileio.c index 850cbc8a2f1..73ded467d52 100644 --- a/usr.bin/mg/fileio.c +++ b/usr.bin/mg/fileio.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fileio.c,v 1.44 2005/01/31 15:48:00 millert Exp $ */ +/* $OpenBSD: fileio.c,v 1.45 2005/02/01 16:04:15 henning Exp $ */ /* * POSIX fileio.c @@ -209,6 +209,7 @@ fbackupfile(const char *fn) if (rename(tname, nname) == -1) { ewprintf("Can't rename temp : %s", strerror(errno)); (void) unlink(tname); + nread = -1; } } free(nname); -- cgit v1.2.3