for new fts library

This commit is contained in:
deraadt 1993-08-06 01:53:33 +00:00
parent 54bfcbbbca
commit f85c326074

View File

@ -36,7 +36,7 @@
#ifndef lint #ifndef lint
/*static char sccsid[] = "from: @(#)function.c 5.17 (Berkeley) 5/24/91";*/ /*static char sccsid[] = "from: @(#)function.c 5.17 (Berkeley) 5/24/91";*/
static char rcsid[] = "$Id: function.c,v 1.6 1993/08/01 18:16:14 mycroft Exp $"; static char rcsid[] = "$Id: function.c,v 1.7 1993/08/06 01:53:33 deraadt Exp $";
#endif /* not lint */ #endif /* not lint */
#include <sys/param.h> #include <sys/param.h>
@ -127,7 +127,7 @@ f_atime(plan, entry)
{ {
extern time_t now; extern time_t now;
COMPARE((now - entry->fts_statb.st_atime + COMPARE((now - entry->fts_statp->st_atime +
SECSPERDAY - 1) / SECSPERDAY, plan->t_data); SECSPERDAY - 1) / SECSPERDAY, plan->t_data);
} }
@ -155,7 +155,7 @@ f_ctime(plan, entry)
{ {
extern time_t now; extern time_t now;
COMPARE((now - entry->fts_statb.st_ctime + COMPARE((now - entry->fts_statp->st_ctime +
SECSPERDAY - 1) / SECSPERDAY, plan->t_data); SECSPERDAY - 1) / SECSPERDAY, plan->t_data);
} }
@ -326,8 +326,8 @@ f_fstype(plan, entry)
char *p, save[2]; char *p, save[2];
/* only check when we cross mount point */ /* only check when we cross mount point */
if (first || curdev != entry->fts_statb.st_dev) { if (first || curdev != entry->fts_statp->st_dev) {
curdev = entry->fts_statb.st_dev; curdev = entry->fts_statp->st_dev;
/* /*
* Statfs follows symlinks; find wants the link's file system, * Statfs follows symlinks; find wants the link's file system,
@ -449,7 +449,7 @@ f_group(plan, entry)
PLAN *plan; PLAN *plan;
FTSENT *entry; FTSENT *entry;
{ {
return(entry->fts_statb.st_gid == plan->g_data); return(entry->fts_statp->st_gid == plan->g_data);
} }
PLAN * PLAN *
@ -484,7 +484,7 @@ f_inum(plan, entry)
PLAN *plan; PLAN *plan;
FTSENT *entry; FTSENT *entry;
{ {
COMPARE(entry->fts_statb.st_ino, plan->i_data); COMPARE(entry->fts_statp->st_ino, plan->i_data);
} }
PLAN * PLAN *
@ -509,7 +509,7 @@ f_links(plan, entry)
PLAN *plan; PLAN *plan;
FTSENT *entry; FTSENT *entry;
{ {
COMPARE(entry->fts_statb.st_nlink, plan->l_data); COMPARE(entry->fts_statp->st_nlink, plan->l_data);
} }
PLAN * PLAN *
@ -535,7 +535,7 @@ f_ls(plan, entry)
PLAN *plan; PLAN *plan;
FTSENT *entry; FTSENT *entry;
{ {
printlong(entry->fts_path, entry->fts_accpath, &entry->fts_statb); printlong(entry->fts_path, entry->fts_accpath, entry->fts_statp);
return(1); return(1);
} }
@ -583,7 +583,7 @@ f_newer(plan, entry)
PLAN *plan; PLAN *plan;
FTSENT *entry; FTSENT *entry;
{ {
return(entry->fts_statb.st_mtime > plan->t_data); return(entry->fts_statp->st_mtime > plan->t_data);
} }
PLAN * PLAN *
@ -615,7 +615,7 @@ f_nogroup(plan, entry)
{ {
char *group_from_gid(); char *group_from_gid();
return(group_from_gid(entry->fts_statb.st_gid, 1) ? 1 : 0); return(group_from_gid(entry->fts_statp->st_gid, 1) ? 1 : 0);
} }
PLAN * PLAN *
@ -639,7 +639,7 @@ f_nouser(plan, entry)
{ {
char *user_from_uid(); char *user_from_uid();
return(user_from_uid(entry->fts_statb.st_uid, 1) ? 1 : 0); return(user_from_uid(entry->fts_statp->st_uid, 1) ? 1 : 0);
} }
PLAN * PLAN *
@ -663,7 +663,7 @@ f_perm(plan, entry)
{ {
mode_t mode; mode_t mode;
mode = entry->fts_statb.st_mode & mode = entry->fts_statp->st_mode &
(S_ISUID|S_ISGID|S_ISTXT|S_IRWXU|S_IRWXG|S_IRWXO); (S_ISUID|S_ISGID|S_ISTXT|S_IRWXU|S_IRWXG|S_IRWXO);
if (plan->flags) if (plan->flags)
return((plan->m_data | mode) == mode); return((plan->m_data | mode) == mode);
@ -757,8 +757,8 @@ f_size(plan, entry)
{ {
off_t size; off_t size;
size = divsize ? (entry->fts_statb.st_size + FIND_SIZE - 1) / size = divsize ? (entry->fts_statp->st_size + FIND_SIZE - 1) /
FIND_SIZE : entry->fts_statb.st_size; FIND_SIZE : entry->fts_statp->st_size;
COMPARE(size, plan->o_data); COMPARE(size, plan->o_data);
} }
@ -789,7 +789,7 @@ f_type(plan, entry)
PLAN *plan; PLAN *plan;
FTSENT *entry; FTSENT *entry;
{ {
return((entry->fts_statb.st_mode & S_IFMT) == plan->m_data); return((entry->fts_statp->st_mode & S_IFMT) == plan->m_data);
} }
PLAN * PLAN *
@ -843,7 +843,7 @@ f_user(plan, entry)
PLAN *plan; PLAN *plan;
FTSENT *entry; FTSENT *entry;
{ {
return(entry->fts_statb.st_uid == plan->u_data); return(entry->fts_statp->st_uid == plan->u_data);
} }
PLAN * PLAN *
@ -929,7 +929,7 @@ f_mtime(plan, entry)
{ {
extern time_t now; extern time_t now;
COMPARE((now - entry->fts_statb.st_mtime + SECSPERDAY - 1) / COMPARE((now - entry->fts_statp->st_mtime + SECSPERDAY - 1) /
SECSPERDAY, plan->t_data); SECSPERDAY, plan->t_data);
} }