the beginnings of a proper man page for busybox.
[oweals/busybox.git] / utility.c
index c20025cd25d81b6d87d8c6f1a11707cb1d49b928..ade47bde0906d30edff5880cb9ef8e52d207b1c1 100644 (file)
--- a/utility.c
+++ b/utility.c
@@ -317,7 +317,9 @@ const char *timeString(time_t timeVal)
 
     return buf;
 }
+#endif
 
+#if defined BB_TAR || defined BB_CP || defined BB_MV
 /*
  * Write all of the supplied buffer out to a file.
  * This does multiple writes as necessary.
@@ -396,7 +398,7 @@ recursiveAction(const char *fileName, int recurse, int followLinks, int depthFir
                int (*dirAction) (const char *fileName, struct stat* statbuf))
 {
     int status;
-    struct stat statbuf;
+    struct stat statbuf, statbuf1;
     struct dirent *next;
 
     if (followLinks == TRUE)
@@ -404,6 +406,7 @@ recursiveAction(const char *fileName, int recurse, int followLinks, int depthFir
     else
        status = lstat(fileName, &statbuf);
 
+    status = lstat(fileName, &statbuf);
     if (status < 0) {
        perror(fileName);
        return (FALSE);
@@ -424,8 +427,14 @@ recursiveAction(const char *fileName, int recurse, int followLinks, int depthFir
                return (TRUE);
        } 
     }
+    
+    status = lstat(fileName, &statbuf1);
+    if (status < 0) {
+       perror(fileName);
+       return (FALSE);
+    }
 
-    if (S_ISDIR(statbuf.st_mode)) {
+    if (S_ISDIR(statbuf.st_mode) && S_ISDIR(statbuf1.st_mode)) {
        DIR *dir;
        dir = opendir(fileName);
        if (!dir) {
@@ -1012,16 +1021,6 @@ extern struct mntent *findMountPoint(const char *name, const char *table)
 
 
 
-#if !defined BB_MTAB && (defined BB_MOUNT || defined BB_DF )
-extern void whine_if_fstab_is_missing()
-{
-    struct stat statBuf;
-    if (stat("/etc/fstab", &statBuf) < 0) 
-       fprintf(stderr, "/etc/fstab file missing -- install one to name /dev/root.\n\n");
-}
-#endif
-
-
 #if defined BB_DD || defined BB_TAIL
 /*
  * Read a number with a possible multiplier.