Yet another installment in the ongoing tar saga
-Erik
diff --git a/utility.c b/utility.c
index a582f70..0d4799f 100644
--- a/utility.c
+++ b/utility.c
@@ -542,9 +542,12 @@
int recursiveAction(const char *fileName,
int recurse, int followLinks, int depthFirst,
int (*fileAction) (const char *fileName,
- struct stat * statbuf),
+ struct stat * statbuf,
+ void* userData),
int (*dirAction) (const char *fileName,
- struct stat * statbuf))
+ struct stat * statbuf,
+ void* userData),
+ void* userData)
{
int status;
struct stat statbuf;
@@ -569,13 +572,13 @@
if (fileAction == NULL)
return TRUE;
else
- return fileAction(fileName, &statbuf);
+ return fileAction(fileName, &statbuf, userData);
}
if (recurse == FALSE) {
if (S_ISDIR(statbuf.st_mode)) {
if (dirAction != NULL)
- return (dirAction(fileName, &statbuf));
+ return (dirAction(fileName, &statbuf, userData));
else
return TRUE;
}
@@ -590,7 +593,7 @@
return FALSE;
}
if (dirAction != NULL && depthFirst == FALSE) {
- status = dirAction(fileName, &statbuf);
+ status = dirAction(fileName, &statbuf, userData);
if (status == FALSE) {
perror(fileName);
return FALSE;
@@ -610,7 +613,7 @@
sprintf(nextFile, "%s/%s", fileName, next->d_name);
status =
recursiveAction(nextFile, TRUE, followLinks, depthFirst,
- fileAction, dirAction);
+ fileAction, dirAction, userData);
if (status < 0) {
closedir(dir);
return FALSE;
@@ -622,7 +625,7 @@
return FALSE;
}
if (dirAction != NULL && depthFirst == TRUE) {
- status = dirAction(fileName, &statbuf);
+ status = dirAction(fileName, &statbuf, userData);
if (status == FALSE) {
perror(fileName);
return FALSE;
@@ -632,7 +635,7 @@
if (fileAction == NULL)
return TRUE;
else
- return fileAction(fileName, &statbuf);
+ return fileAction(fileName, &statbuf, userData);
}
return TRUE;
}
@@ -1514,19 +1517,6 @@
#endif
-#if defined BB_MTAB
-#define whine_if_fstab_is_missing() {}
-#else
-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
-
/* END CODE */
/*
Local Variables: