diff options
author | eivind <eivind@FreeBSD.org> | 2000-07-28 20:02:42 +0000 |
---|---|---|
committer | eivind <eivind@FreeBSD.org> | 2000-07-28 20:02:42 +0000 |
commit | bc7a13a526a9081bc96562ea9b55b990910ebd89 (patch) | |
tree | 92497e38b2fbf11e644904aa2f6c97e57292a790 /usr.bin | |
parent | bf8742e138d6b936e74e9d6cc2c60fef4b0374ed (diff) | |
download | FreeBSD-src-bc7a13a526a9081bc96562ea9b55b990910ebd89.zip FreeBSD-src-bc7a13a526a9081bc96562ea9b55b990910ebd89.tar.gz |
Make passing unknown fstypes to -fstype result in a warning instead of
an error. As it was, which find command lines that would work (be
accepted at all) was dependent on the presently running kernel, making
script writing and porting hard.
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/find/function.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/usr.bin/find/function.c b/usr.bin/find/function.c index 1534ee2..670d102 100644 --- a/usr.bin/find/function.c +++ b/usr.bin/find/function.c @@ -564,6 +564,14 @@ f_fstype(plan, entry) } #if !defined(__NetBSD__) +int +f_always_false(plan, entry) + PLAN *plan; + FTSENT *entry; +{ + return (0); +} + PLAN * c_fstype(arg) char *arg; @@ -600,8 +608,14 @@ c_fstype(arg) } break; } - errx(1, "%s: unknown file type", arg); - /* NOTREACHED */ + /* + * We need to make filesystem checks for filesystems + * that exists but aren't in the kernel work. + */ + fprintf(stderr, "Warning: Unknown filesystem type %s\n", arg); + free(new); + + return (palloc(N_FSTYPE, f_always_false)); } #endif |