diff options
author | Rob Landley <rob@landley.net> | 2006-03-13 15:45:16 +0000 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2006-03-13 15:45:16 +0000 |
commit | c5b1d4d6b14f22b5e2f7ae42eb01bf2746b8001c (patch) | |
tree | e44405a7e5212758d20a9595cbb0a82609d4a347 /findutils | |
parent | 965030e35aed6a8b9c09267baba4c2342d5223d6 (diff) | |
download | busybox-c5b1d4d6b14f22b5e2f7ae42eb01bf2746b8001c.tar.gz |
Patch from Denis Vlasenko to add xstat() and use it.
Diffstat (limited to 'findutils')
-rw-r--r-- | findutils/find.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/findutils/find.c b/findutils/find.c index 0f2f2144c..c6aaf7aab 100644 --- a/findutils/find.c +++ b/findutils/find.c @@ -274,15 +274,13 @@ int find_main(int argc, char **argv) xdev_dev = xmalloc ( xdev_count * sizeof( dev_t )); if ( firstopt == 1 ) { - if ( stat ( ".", &stbuf ) < 0 ) - bb_error_msg_and_die("could not stat '.'" ); + xstat ( ".", &stbuf ); xdev_dev [0] = stbuf. st_dev; } else { for (i = 1; i < firstopt; i++) { - if ( stat ( argv [i], &stbuf ) < 0 ) - bb_error_msg_and_die("could not stat '%s'", argv [i] ); + xstat ( argv [i], &stbuf ); xdev_dev [i-1] = stbuf. st_dev; } } @@ -292,8 +290,7 @@ int find_main(int argc, char **argv) struct stat stat_newer; if (++i == argc) bb_error_msg_and_die(msg_req_arg, "-newer"); - if (stat (argv[i], &stat_newer) != 0) - bb_error_msg_and_die("file %s not found", argv[i]); + xstat (argv[i], &stat_newer); newer_mtime = stat_newer.st_mtime; #endif #ifdef CONFIG_FEATURE_FIND_INUM |