Eliminated seeks so that we work correctly on pipes, and removed reliance on
[oweals/busybox.git] / cp_mv.c
diff --git a/cp_mv.c b/cp_mv.c
index fb48d3c5cecc5c4698e97a1102d7aa7de48977cf..3c19f1a0495bcb1f6b1989ee140ae480a0f254cf 100644 (file)
--- a/cp_mv.c
+++ b/cp_mv.c
@@ -147,7 +147,7 @@ cp_mv_Action(const char *fileName, struct stat *statbuf, void* junk)
                        add_to_ino_dev_hashtable(statbuf, destName);
                }
        }
-       return copy_file(fileName, destName, preserveFlag, followLinks, forceFlag);
+       return copy_file(fileName, destName, preserveFlag, followLinks, forceFlag, FALSE);
 }
 
 static int
@@ -256,18 +256,16 @@ extern int cp_mv_main(int argc, char **argv)
                        int                     state = 0;
                        char            *pushd, *d, *p;
 
-                       if ((pushd = getcwd(NULL, BUFSIZ + 1)) == NULL) {
-                               perror_msg("getcwd()");
+                       if ((pushd = xgetcwd(0)) == NULL)
                                continue;
-                       }
+
                        if (chdir(baseDestName) < 0) {
                                perror_msg("chdir(%s)", baseSrcName);
                                continue;
                        }
-                       if ((d = getcwd(NULL, BUFSIZ + 1)) == NULL) {
-                               perror_msg("getcwd()");
+                       if ((d = xgetcwd(0)) == NULL)
                                continue;
-                       }
+
                        while (!state && *d != '\0') {
                                if (stat(d, &sb) < 0) { /* stat not lstat - always dereference targets */
                                        perror_msg("stat(%s)", d);