summaryrefslogtreecommitdiff
path: root/cp_mv.c
diff options
context:
space:
mode:
authorMatt Kraai2000-12-18 03:57:16 +0000
committerMatt Kraai2000-12-18 03:57:16 +0000
commit1fa1adea2ae16d4f4c82d7466905dce4c6edd5f5 (patch)
treeb85a425c19b299f5d8635599e11c78c96f12a4c2 /cp_mv.c
parent0dab82997777bffb95d01d68e1628ee79207a03d (diff)
downloadbusybox-1fa1adea2ae16d4f4c82d7466905dce4c6edd5f5.zip
busybox-1fa1adea2ae16d4f4c82d7466905dce4c6edd5f5.tar.gz
Change calls to error_msg.* and strerror to use perror_msg.*.
Diffstat (limited to 'cp_mv.c')
-rw-r--r--cp_mv.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/cp_mv.c b/cp_mv.c
index b334206..0b32882 100644
--- a/cp_mv.c
+++ b/cp_mv.c
@@ -130,8 +130,7 @@ cp_mv_Action(const char *fileName, struct stat *statbuf, void* junk)
if (mv_Action_first_time && (dz_i == is_mv)) {
mv_Action_first_time = errno = 0;
if (rename(fileName, destName) < 0 && errno != EXDEV) {
- error_msg("rename(%s, %s): %s\n", fileName, destName,
- strerror(errno));
+ perror_msg("rename(%s, %s)", fileName, destName);
goto do_copyFile; /* Try anyway... */
}
else if (errno == EXDEV)
@@ -143,7 +142,7 @@ cp_mv_Action(const char *fileName, struct stat *statbuf, void* junk)
if (preserveFlag == TRUE && statbuf->st_nlink > 1) {
if (is_in_ino_dev_hashtable(statbuf, &name)) {
if (link(name, destName) < 0) {
- error_msg("link(%s, %s): %s\n", name, destName, strerror(errno));
+ perror_msg("link(%s, %s)", name, destName);
return FALSE;
}
return TRUE;
@@ -162,11 +161,11 @@ rm_Action(const char *fileName, struct stat *statbuf, void* junk)
if (S_ISDIR(statbuf->st_mode)) {
if (rmdir(fileName) < 0) {
- error_msg("rmdir(%s): %s\n", fileName, strerror(errno));
+ perror_msg("rmdir(%s)", fileName);
status = FALSE;
}
} else if (unlink(fileName) < 0) {
- error_msg("unlink(%s): %s\n", fileName, strerror(errno));
+ perror_msg("unlink(%s)", fileName);
status = FALSE;
}
return status;
@@ -260,20 +259,20 @@ extern int cp_mv_main(int argc, char **argv)
char *pushd, *d, *p;
if ((pushd = getcwd(NULL, BUFSIZ + 1)) == NULL) {
- error_msg("getcwd(): %s\n", strerror(errno));
+ perror_msg("getcwd()");
continue;
}
if (chdir(baseDestName) < 0) {
- error_msg("chdir(%s): %s\n", baseSrcName, strerror(errno));
+ perror_msg("chdir(%s)", baseSrcName);
continue;
}
if ((d = getcwd(NULL, BUFSIZ + 1)) == NULL) {
- error_msg("getcwd(): %s\n", strerror(errno));
+ perror_msg("getcwd()");
continue;
}
while (!state && *d != '\0') {
if (stat(d, &sb) < 0) { /* stat not lstat - always dereference targets */
- error_msg("stat(%s): %s\n", d, strerror(errno));
+ perror_msg("stat(%s)", d);
state = -1;
continue;
}
@@ -290,7 +289,7 @@ extern int cp_mv_main(int argc, char **argv)
}
}
if (chdir(pushd) < 0) {
- error_msg("chdir(%s): %s\n", pushd, strerror(errno));
+ perror_msg("chdir(%s)", pushd);
free(pushd);
free(d);
continue;