fts_open(argv, options, compar)
char * const *argv;
register int options;
- int (*compar)();
+ int (*compar) __P((const FTSENT **, const FTSENT **));
{
register FTS *sp;
register FTSENT *p, *root;
if ((sp = malloc((u_int)sizeof(FTS))) == NULL)
return (NULL);
bzero(sp, sizeof(FTS));
- sp->fts_compar = compar;
+ sp->fts_compar = (int (*) __P((const void *, const void *))) compar;
sp->fts_options = options;
/* Logical walks turn on NOCHDIR; symbolic links are too hard. */
}
p->fts_info = FTS_DP;
return (p);
- }
+ }
/* Rebuild if only read the names and now traversing. */
if (sp->fts_child && sp->fts_options & FTS_NAMEONLY) {
if (instr == FTS_NAMEONLY) {
sp->fts_options |= FTS_NAMEONLY;
instr = BNAMES;
- } else
+ } else
instr = BCHILD;
/*
p->fts_accpath = cur->fts_accpath;
} else if (nlinks == 0
#ifdef DT_DIR
- || nlinks > 0 &&
+ || nlinks > 0 &&
dp->d_type != DT_DIR && dp->d_type != DT_UNKNOWN
#endif
) {
/* If user needs stat info, stat buffer already allocated. */
sbp = ISSET(FTS_NOSTAT) ? &sb : p->fts_statp;
-
+
/*
* If doing a logical walk, or application requested FTS_FOLLOW, do
* a stat(2). If that fails, check for a non-existent symlink. If
if (!lstat(p->fts_accpath, sbp)) {
errno = 0;
return (FTS_SLNONE);
- }
+ }
p->fts_errno = saved_errno;
goto err;
}
* Allow essentially unlimited paths; find, rm, ls should all work on any tree.
* Most systems will allow creation of paths much longer than MAXPATHLEN, even
* though the kernel won't resolve them. Add the size (not just what's needed)
- * plus 256 bytes so don't realloc the path 2 bytes at a time.
+ * plus 256 bytes so don't realloc the path 2 bytes at a time.
*/
static int
fts_palloc(sp, more)