*
*/
-#include "busybox.h"
-#define BB_DECLARE_EXTERN
-#define bb_need_name_too_long
-#define bb_need_omitting_directory
-#define bb_need_not_a_directory
-#include "messages.c"
-
#include <stdio.h>
#include <time.h>
#include <utime.h>
#include <errno.h>
#include <getopt.h>
#include <stdlib.h>
+#include "busybox.h"
+#define BB_DECLARE_EXTERN
+#define bb_need_name_too_long
+#define bb_need_omitting_directory
+#define bb_need_not_a_directory
+#include "messages.c"
+
static const int is_cp = 0;
static const int is_mv = 1;
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
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);