summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrillig <rillig>2007-11-01 21:57:37 +0000
committerrillig <rillig>2007-11-01 21:57:37 +0000
commit7dc953f2f064ddd414215202a6bef988ec986067 (patch)
tree7f12d931600761fc4ef3513f78c77173f1b6dd19
parent48105fde026cdc51607f751ee8469bfe419e9e44 (diff)
downloadpkgsrc-7dc953f2f064ddd414215202a6bef988ec986067.tar.gz
When rename(2) fails, it is useful to know some details about the
filenames that have been involved. Do not use assert() for error checking.
-rw-r--r--pkgtools/pkg_install/files/add/perform.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/pkgtools/pkg_install/files/add/perform.c b/pkgtools/pkg_install/files/add/perform.c
index 77cbc709aac..452b6543a45 100644
--- a/pkgtools/pkg_install/files/add/perform.c
+++ b/pkgtools/pkg_install/files/add/perform.c
@@ -1,4 +1,4 @@
-/* $NetBSD: perform.c,v 1.63 2007/09/11 13:39:05 rillig Exp $ */
+/* $NetBSD: perform.c,v 1.64 2007/11/01 21:57:37 rillig Exp $ */
#if HAVE_CONFIG_H
#include "config.h"
@@ -14,7 +14,7 @@
#if 0
static const char *rcsid = "from FreeBSD Id: perform.c,v 1.44 1997/10/13 15:03:46 jkh Exp";
#else
-__RCSID("$NetBSD: perform.c,v 1.63 2007/09/11 13:39:05 rillig Exp $");
+__RCSID("$NetBSD: perform.c,v 1.64 2007/11/01 21:57:37 rillig Exp $");
#endif
#endif
@@ -357,7 +357,7 @@ ignore_replace_depends_check:
if (Verbose)
printf("mv %s %s\n", replace_from, replace_via);
if (rename(replace_from, replace_via) != 0)
- err(EXIT_FAILURE, "rename failed");
+ err(EXIT_FAILURE, "renaming %s to %s failed", replace_from, replace_via);
*replacing = 1;
}
@@ -983,7 +983,8 @@ success:
* (see also step 2/4)
*/
rc = rename(replace_via, replace_to);
- assert(rc == 0);
+ if (rc != 0)
+ err(EXIT_FAILURE, "renaming %s to %s failed", replace_via, replace_to);
/*
* Upgrade step 4/4: Fix pkgs that depend on us to