#ifndef lint
static const char rcsid[] =
- "$Id: dirs.c,v 1.17 2002/01/25 15:08:59 stelian Exp $";
+ "$Id: dirs.c,v 1.20 2002/06/25 19:00:38 stelian Exp $";
#endif /* not lint */
#include <config.h>
char d_name[ODIRSIZ];
};
-#ifdef __linux__
+#if defined(__linux__) || defined(sunos)
static struct inotab *allocinotab __P((dump_ino_t, struct new_bsd_inode *, long));
#else
static struct inotab *allocinotab __P((dump_ino_t, struct dinode *, long));
extractdirs(int genmode)
{
int i;
-#ifdef __linux__
+#if defined(__linux__) || defined(sunos)
struct new_bsd_inode *ip;
#else
struct dinode *ip;
while (*path == '/')
path++;
dp = NULL;
+#ifdef __linux__
while ((name = strsep(&path, "/")) != NULL && *name /* != NULL */) {
+#else
+ while ((name = strtok_r(NULL, "/", &path)) != NULL && *name /* != NULL */) {
+#endif
if ((dp = searchdir(ino, name)) == NULL)
return (NULL);
ino = dp->d_ino;
if (!Bcvt)
dp->d_namlen = dp->d_type;
# endif
+ if (dp->d_namlen == 0 && dp->d_type != 0)
+ dp->d_namlen = dp->d_type;
dp->d_type = DT_UNKNOWN;
}
#ifdef DIRDEBUG
/*
* These variables are "local" to the following two functions.
*/
-char dirbuf[DIRBLKSIZ];
-long dirloc = 0;
-long prev = 0;
+static char dirbuf[DIRBLKSIZ];
+static long dirloc = 0;
+static long prev = 0;
/*
* add a new directory entry to a file.
ep->e_flags &= ~NEW;
continue;
}
- if (node.ino == ROOTINO &&
+ if ((flags & FORCE) == 0 &&
+ node.ino == ROOTINO &&
reply("set owner/mode for '.'") == FAIL)
continue;
}