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.
int (*dirAction) (const char *fileName, struct stat* statbuf))
{
int status;
- struct stat statbuf;
+ struct stat statbuf, statbuf1;
struct dirent *next;
if (followLinks == TRUE)
else
status = lstat(fileName, &statbuf);
+ status = lstat(fileName, &statbuf);
if (status < 0) {
perror(fileName);
return (FALSE);
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) {
-#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.