diff options
author | Henning Brauer <henning@cvs.openbsd.org> | 2005-02-01 16:04:16 +0000 |
---|---|---|
committer | Henning Brauer <henning@cvs.openbsd.org> | 2005-02-01 16:04:16 +0000 |
commit | 04c5fd91e855b09a22bd5a97ffa67325185e9745 (patch) | |
tree | 0e4ce30c174712347c4d125d3b7fba52178fa8c2 /usr.bin | |
parent | 21c045b816dd3a61b8888854db6126834e078870 (diff) |
make fbackupfile() return FALSE when the rename(2) from the
mkstemp()-derived name to the filename~ one fails
From: Han Boetes <han@mijncomputer.nl>
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/mg/fileio.c | 3 |
1 files changed, 2 insertions, 1 deletions
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); |