From c5b1d4d6b14f22b5e2f7ae42eb01bf2746b8001c Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Mon, 13 Mar 2006 15:45:16 +0000 Subject: Patch from Denis Vlasenko to add xstat() and use it. --- findutils/find.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'findutils') diff --git a/findutils/find.c b/findutils/find.c index 0f2f214..c6aaf7a 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 -- cgit v1.1