X-Git-Url: https://git.wh0rd.org/?p=dump.git;a=blobdiff_plain;f=restore%2Fdirs.c;h=45d4cbe0743981208e96fa82ce6544ee4deb83de;hp=60f5b23673b15eebe42576aa3887ded3b2e8c894;hb=fe0e02857a1ff7db4bf8cb28780de7ecf2f24234;hpb=633963a251fb12a63e43a7f6f2391dc9507972a7 diff --git a/restore/dirs.c b/restore/dirs.c index 60f5b23..45d4cbe 100644 --- a/restore/dirs.c +++ b/restore/dirs.c @@ -46,7 +46,7 @@ #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.18 2002/02/04 11:18:46 stelian Exp $"; #endif /* not lint */ #include @@ -140,7 +140,7 @@ struct odirect { 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)); @@ -165,7 +165,7 @@ void extractdirs(int genmode) { int i; -#ifdef __linux__ +#if defined(__linux__) || defined(sunos) struct new_bsd_inode *ip; #else struct dinode *ip; @@ -325,7 +325,11 @@ pathsearch(const char *pathname) 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; @@ -431,9 +435,9 @@ putdir(char *buf, size_t size) /* * 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.