aboutsummaryrefslogtreecommitdiff
path: root/coreutils/stat.c
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2008-03-17 09:04:04 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2008-03-17 09:04:04 +0000
commit85c247161b9e1e7c71ebcb874ed7b6a23b6a5b50 (patch)
tree0b60f25ea0ebfbac5d9b3fa22f123aadaecd6663 /coreutils/stat.c
parent081eb71ebd7954a67287816a9a6fff80e8c5319a (diff)
downloadbusybox-w32-85c247161b9e1e7c71ebcb874ed7b6a23b6a5b50.tar.gz
busybox-w32-85c247161b9e1e7c71ebcb874ed7b6a23b6a5b50.tar.bz2
busybox-w32-85c247161b9e1e7c71ebcb874ed7b6a23b6a5b50.zip
*: fix fallout from -Wunused-parameter
function old new delta bbunpack 358 366 +8 passwd_main 1070 1072 +2 handle_incoming_and_exit 2651 2653 +2 getpty 88 86 -2 script_main 975 972 -3 inetd_main 2036 2033 -3 dname_enc 377 373 -4 make_new_session 474 462 -12 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 3/5 up/down: 12/-24) Total: -12 bytes text data bss dec hex filename 797429 658 7428 805515 c4a8b busybox_old 797417 658 7428 805503 c4a7f busybox_unstripped
Diffstat (limited to 'coreutils/stat.c')
-rw-r--r--coreutils/stat.c21
1 files changed, 18 insertions, 3 deletions
diff --git a/coreutils/stat.c b/coreutils/stat.c
index 5996268ef..b2b1913a9 100644
--- a/coreutils/stat.c
+++ b/coreutils/stat.c
@@ -21,6 +21,12 @@
21#define OPT_DEREFERENCE (1 << 2) 21#define OPT_DEREFERENCE (1 << 2)
22#define OPT_SELINUX (1 << 3) 22#define OPT_SELINUX (1 << 3)
23 23
24#if ENABLE_FEATURE_STAT_FORMAT
25typedef bool (*statfunc_ptr)(const char *, const char *);
26#else
27typedef bool (*statfunc_ptr)(const char *);
28#endif
29
24static const char *file_type(const struct stat *st) 30static const char *file_type(const struct stat *st)
25{ 31{
26 /* See POSIX 1003.1-2001 XCU Table 4-8 lines 17093-17107 32 /* See POSIX 1003.1-2001 XCU Table 4-8 lines 17093-17107
@@ -338,8 +344,14 @@ static void print_it(const char *masterformat, const char *filename,
338#endif 344#endif
339 345
340/* Stat the file system and print what we find. */ 346/* Stat the file system and print what we find. */
347#if !ENABLE_FEATURE_STAT_FORMAT
348#define do_statfs(filename, format) do_statfs(filename)
349#endif
341static bool do_statfs(const char *filename, const char *format) 350static bool do_statfs(const char *filename, const char *format)
342{ 351{
352#if !ENABLE_FEATURE_STAT_FORMAT
353 const char *format;
354#endif
343 struct statfs statfsbuf; 355 struct statfs statfsbuf;
344#if ENABLE_SELINUX 356#if ENABLE_SELINUX
345 security_context_t scontext = NULL; 357 security_context_t scontext = NULL;
@@ -447,6 +459,9 @@ static bool do_statfs(const char *filename, const char *format)
447} 459}
448 460
449/* stat the file and print what we find */ 461/* stat the file and print what we find */
462#if !ENABLE_FEATURE_STAT_FORMAT
463#define do_stat(filename, format) do_stat(filename)
464#endif
450static bool do_stat(const char *filename, const char *format) 465static bool do_stat(const char *filename, const char *format)
451{ 466{
452 struct stat statbuf; 467 struct stat statbuf;
@@ -612,10 +627,10 @@ static bool do_stat(const char *filename, const char *format)
612int stat_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 627int stat_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
613int stat_main(int argc, char **argv) 628int stat_main(int argc, char **argv)
614{ 629{
615 char *format = NULL; 630 USE_FEATURE_STAT_FORMAT(char *format = NULL;)
616 int i; 631 int i;
617 int ok = 1; 632 int ok = 1;
618 bool (*statfunc)(const char *, const char *) = do_stat; 633 statfunc_ptr statfunc = do_stat;
619 634
620 getopt32(argv, "ftL" 635 getopt32(argv, "ftL"
621 USE_SELINUX("Z") 636 USE_SELINUX("Z")
@@ -633,7 +648,7 @@ int stat_main(int argc, char **argv)
633 } 648 }
634#endif /* ENABLE_SELINUX */ 649#endif /* ENABLE_SELINUX */
635 for (i = optind; i < argc; ++i) 650 for (i = optind; i < argc; ++i)
636 ok &= statfunc(argv[i], format); 651 ok &= statfunc(argv[i] USE_FEATURE_STAT_FORMAT(, format));
637 652
638 return (ok ? EXIT_SUCCESS : EXIT_FAILURE); 653 return (ok ? EXIT_SUCCESS : EXIT_FAILURE);
639} 654}