need to change iphlen earlier; icmp_error needs original ip_len; cleanups
[unix-history] / usr / src / usr.bin / find / function.c
index 0f325b1..80fc274 100644 (file)
@@ -9,7 +9,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)function.c 5.5 (Berkeley) %G%";
+static char sccsid[] = "@(#)function.c 5.8 (Berkeley) %G%";
 #endif /* not lint */
 
 #include <sys/types.h>
 #endif /* not lint */
 
 #include <sys/types.h>
@@ -307,6 +307,7 @@ f_fstype(plan, entry)
 
        /* only check when we cross mount point */
        if (first || curdev != entry->fts_statb.st_dev) {
 
        /* only check when we cross mount point */
        if (first || curdev != entry->fts_statb.st_dev) {
+               curdev = entry->fts_statb.st_dev;
                if (statfs(entry->fts_accpath, &sb)) {
                        (void)fprintf(stderr, "find: %s: %s.\n",
                            entry->fts_accpath, strerror(errno));
                if (statfs(entry->fts_accpath, &sb)) {
                        (void)fprintf(stderr, "find: %s: %s.\n",
                            entry->fts_accpath, strerror(errno));
@@ -612,6 +613,7 @@ c_perm(perm)
        char *perm;
 {
        PLAN *new;
        char *perm;
 {
        PLAN *new;
+       mode_t *set, *setmode();
 
        ftsoptions &= ~FTS_NOSTAT;
 
 
        ftsoptions &= ~FTS_NOSTAT;
 
@@ -622,10 +624,10 @@ c_perm(perm)
                ++perm;
        }
 
                ++perm;
        }
 
-       if (setmode(perm))
+       if ((set = setmode(perm)) == NULL)
                bad_arg("-perm", "illegal mode string");
 
                bad_arg("-perm", "illegal mode string");
 
-       new->m_data = getmode(0);
+       new->m_data = getmode(set, 0);
        return(new);
 }
  
        return(new);
 }
  
@@ -732,7 +734,7 @@ f_type(plan, entry)
        PLAN *plan;
        FTSENT *entry;
 {
        PLAN *plan;
        FTSENT *entry;
 {
-       return(entry->fts_statb.st_mode & plan->m_data);
+       return((entry->fts_statb.st_mode & S_IFMT) == plan->m_data);
 }
  
 PLAN *
 }
  
 PLAN *