diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2008-03-17 09:04:04 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2008-03-17 09:04:04 +0000 |
commit | 85c247161b9e1e7c71ebcb874ed7b6a23b6a5b50 (patch) | |
tree | 0b60f25ea0ebfbac5d9b3fa22f123aadaecd6663 | |
parent | 081eb71ebd7954a67287816a9a6fff80e8c5319a (diff) | |
download | busybox-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
36 files changed, 156 insertions, 58 deletions
diff --git a/applets/applets.c b/applets/applets.c index 40c482408..fbe766623 100644 --- a/applets/applets.c +++ b/applets/applets.c | |||
@@ -11,8 +11,8 @@ | |||
11 | #include "busybox.h" | 11 | #include "busybox.h" |
12 | 12 | ||
13 | #if ENABLE_BUILD_LIBBUSYBOX | 13 | #if ENABLE_BUILD_LIBBUSYBOX |
14 | int main(int argc, char **argv) | 14 | int main(int argc ATTRIBUTE_UNUSED, char **argv) |
15 | { | 15 | { |
16 | return lbb_main(argc, argv); | 16 | return lbb_main(argv); |
17 | } | 17 | } |
18 | #endif | 18 | #endif |
diff --git a/archival/bzip2.c b/archival/bzip2.c index 76963365f..eb570c434 100644 --- a/archival/bzip2.c +++ b/archival/bzip2.c | |||
@@ -141,7 +141,7 @@ char* make_new_name_bzip2(char *filename) | |||
141 | } | 141 | } |
142 | 142 | ||
143 | int bzip2_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; | 143 | int bzip2_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; |
144 | int bzip2_main(int argc, char **argv) | 144 | int bzip2_main(int argc ATTRIBUTE_UNUSED, char **argv) |
145 | { | 145 | { |
146 | unsigned opt; | 146 | unsigned opt; |
147 | 147 | ||
diff --git a/archival/gzip.c b/archival/gzip.c index 36502faf7..a96d02911 100644 --- a/archival/gzip.c +++ b/archival/gzip.c | |||
@@ -2026,7 +2026,11 @@ USE_DESKTOP(long long) int pack_gzip(void) | |||
2026 | } | 2026 | } |
2027 | 2027 | ||
2028 | int gzip_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; | 2028 | int gzip_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; |
2029 | #if ENABLE_GUNZIP | ||
2029 | int gzip_main(int argc, char **argv) | 2030 | int gzip_main(int argc, char **argv) |
2031 | #else | ||
2032 | int gzip_main(int argc ATTRIBUTE_UNUSED, char **argv) | ||
2033 | #endif | ||
2030 | { | 2034 | { |
2031 | unsigned opt; | 2035 | unsigned opt; |
2032 | 2036 | ||
diff --git a/console-tools/reset.c b/console-tools/reset.c index f36ef544c..a2bf44d9f 100644 --- a/console-tools/reset.c +++ b/console-tools/reset.c | |||
@@ -40,7 +40,7 @@ int reset_main(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED) | |||
40 | #if ENABLE_STTY | 40 | #if ENABLE_STTY |
41 | return stty_main(2, (char**)args); | 41 | return stty_main(2, (char**)args); |
42 | #else | 42 | #else |
43 | execvp("stty", args); | 43 | execvp("stty", (char**)args); |
44 | #endif | 44 | #endif |
45 | } | 45 | } |
46 | return EXIT_SUCCESS; | 46 | return EXIT_SUCCESS; |
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 | ||
25 | typedef bool (*statfunc_ptr)(const char *, const char *); | ||
26 | #else | ||
27 | typedef bool (*statfunc_ptr)(const char *); | ||
28 | #endif | ||
29 | |||
24 | static const char *file_type(const struct stat *st) | 30 | static 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 | ||
341 | static bool do_statfs(const char *filename, const char *format) | 350 | static 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 | ||
450 | static bool do_stat(const char *filename, const char *format) | 465 | static 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) | |||
612 | int stat_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; | 627 | int stat_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; |
613 | int stat_main(int argc, char **argv) | 628 | int 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 | } |
diff --git a/findutils/find.c b/findutils/find.c index 50c790161..634fbd189 100644 --- a/findutils/find.c +++ b/findutils/find.c | |||
@@ -374,7 +374,10 @@ ACTF(context) | |||
374 | #endif | 374 | #endif |
375 | 375 | ||
376 | 376 | ||
377 | static int fileAction(const char *fileName, struct stat *statbuf, void *userData, int depth) | 377 | static int fileAction(const char *fileName, |
378 | struct stat *statbuf, | ||
379 | void *userData SKIP_FEATURE_FIND_MAXDEPTH(ATTRIBUTE_UNUSED), | ||
380 | int depth SKIP_FEATURE_FIND_MAXDEPTH(ATTRIBUTE_UNUSED)) | ||
378 | { | 381 | { |
379 | int i; | 382 | int i; |
380 | #if ENABLE_FEATURE_FIND_MAXDEPTH | 383 | #if ENABLE_FEATURE_FIND_MAXDEPTH |
diff --git a/include/busybox.h b/include/busybox.h index 52720244b..cad45ac00 100644 --- a/include/busybox.h +++ b/include/busybox.h | |||
@@ -64,9 +64,9 @@ void lbb_prepare(const char *applet | |||
64 | ) MAIN_EXTERNALLY_VISIBLE; | 64 | ) MAIN_EXTERNALLY_VISIBLE; |
65 | #if ENABLE_BUILD_LIBBUSYBOX | 65 | #if ENABLE_BUILD_LIBBUSYBOX |
66 | #if ENABLE_FEATURE_SHARED_BUSYBOX | 66 | #if ENABLE_FEATURE_SHARED_BUSYBOX |
67 | int lbb_main(int argc, char **argv) EXTERNALLY_VISIBLE; | 67 | int lbb_main(char **argv) EXTERNALLY_VISIBLE; |
68 | #else | 68 | #else |
69 | int lbb_main(int argc, char **argv); | 69 | int lbb_main(char **argv); |
70 | #endif | 70 | #endif |
71 | #endif | 71 | #endif |
72 | 72 | ||
diff --git a/include/libbb.h b/include/libbb.h index df8b0ecdb..c6c2be244 100644 --- a/include/libbb.h +++ b/include/libbb.h | |||
@@ -237,7 +237,8 @@ extern int recursive_action(const char *fileName, unsigned flags, | |||
237 | int (*dirAction) (const char *fileName, struct stat* statbuf, void* userData, int depth), | 237 | int (*dirAction) (const char *fileName, struct stat* statbuf, void* userData, int depth), |
238 | void* userData, unsigned depth); | 238 | void* userData, unsigned depth); |
239 | extern int device_open(const char *device, int mode); | 239 | extern int device_open(const char *device, int mode); |
240 | extern int getpty(char *line, int size); | 240 | enum { GETPTY_BUFSIZE = 16 }; /* more than enough for "/dev/ttyXXX" */ |
241 | extern int getpty(char *line); | ||
241 | extern int get_console_fd(void); | 242 | extern int get_console_fd(void); |
242 | extern char *find_block_device(const char *path); | 243 | extern char *find_block_device(const char *path); |
243 | /* bb_copyfd_XX print read/write errors and return -1 if they occur */ | 244 | /* bb_copyfd_XX print read/write errors and return -1 if they occur */ |
diff --git a/include/usage.h b/include/usage.h index f94fa2f62..507a52dab 100644 --- a/include/usage.h +++ b/include/usage.h | |||
@@ -989,6 +989,7 @@ | |||
989 | "" | 989 | "" |
990 | #define false_full_usage \ | 990 | #define false_full_usage \ |
991 | "Return an exit code of FALSE (1)" | 991 | "Return an exit code of FALSE (1)" |
992 | |||
992 | #define false_example_usage \ | 993 | #define false_example_usage \ |
993 | "$ false\n" \ | 994 | "$ false\n" \ |
994 | "$ echo $?\n" \ | 995 | "$ echo $?\n" \ |
diff --git a/init/halt.c b/init/halt.c index c50d8af63..1f0fae302 100644 --- a/init/halt.c +++ b/init/halt.c | |||
@@ -16,7 +16,7 @@ | |||
16 | #endif | 16 | #endif |
17 | 17 | ||
18 | int halt_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; | 18 | int halt_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; |
19 | int halt_main(int argc, char **argv) | 19 | int halt_main(int argc ATTRIBUTE_UNUSED, char **argv) |
20 | { | 20 | { |
21 | static const int magic[] = { | 21 | static const int magic[] = { |
22 | #ifdef RB_HALT_SYSTEM | 22 | #ifdef RB_HALT_SYSTEM |
diff --git a/libbb/appletlib.c b/libbb/appletlib.c index de27dd80e..aade9046a 100644 --- a/libbb/appletlib.c +++ b/libbb/appletlib.c | |||
@@ -661,7 +661,7 @@ void run_applet_and_exit(const char *name, char **argv) | |||
661 | 661 | ||
662 | 662 | ||
663 | #if ENABLE_BUILD_LIBBUSYBOX | 663 | #if ENABLE_BUILD_LIBBUSYBOX |
664 | int lbb_main(int argc, char **argv) | 664 | int lbb_main(char **argv) |
665 | #else | 665 | #else |
666 | int main(int argc ATTRIBUTE_UNUSED, char **argv) | 666 | int main(int argc ATTRIBUTE_UNUSED, char **argv) |
667 | #endif | 667 | #endif |
diff --git a/libbb/getpty.c b/libbb/getpty.c index c006e34f5..36b3c6842 100644 --- a/libbb/getpty.c +++ b/libbb/getpty.c | |||
@@ -10,7 +10,9 @@ | |||
10 | 10 | ||
11 | #define DEBUG 0 | 11 | #define DEBUG 0 |
12 | 12 | ||
13 | int getpty(char *line, int size) | 13 | #define DEBUG 0 |
14 | |||
15 | int getpty(char *line) | ||
14 | { | 16 | { |
15 | int p; | 17 | int p; |
16 | #if ENABLE_FEATURE_DEVPTS | 18 | #if ENABLE_FEATURE_DEVPTS |
@@ -24,7 +26,7 @@ int getpty(char *line, int size) | |||
24 | bb_perror_msg("ptsname error (is /dev/pts mounted?)"); | 26 | bb_perror_msg("ptsname error (is /dev/pts mounted?)"); |
25 | return -1; | 27 | return -1; |
26 | } | 28 | } |
27 | safe_strncpy(line, name, size); | 29 | safe_strncpy(line, name, GETPTY_BUFSIZE); |
28 | return p; | 30 | return p; |
29 | } | 31 | } |
30 | #else | 32 | #else |
diff --git a/libbb/lineedit.c b/libbb/lineedit.c index 7e408207c..b25386bc0 100644 --- a/libbb/lineedit.c +++ b/libbb/lineedit.c | |||
@@ -294,7 +294,12 @@ static void redraw(int y, int back_cursor) | |||
294 | 294 | ||
295 | /* Delete the char in front of the cursor, optionally saving it | 295 | /* Delete the char in front of the cursor, optionally saving it |
296 | * for later putback */ | 296 | * for later putback */ |
297 | #if !ENABLE_FEATURE_EDITING_VI | ||
298 | static void input_delete(void) | ||
299 | #define input_delete(save) input_delete() | ||
300 | #else | ||
297 | static void input_delete(int save) | 301 | static void input_delete(int save) |
302 | #endif | ||
298 | { | 303 | { |
299 | int j = cursor; | 304 | int j = cursor; |
300 | 305 | ||
diff --git a/loginutils/login.c b/loginutils/login.c index 79e7494bf..d7eb8d35b 100644 --- a/loginutils/login.c +++ b/loginutils/login.c | |||
@@ -130,9 +130,7 @@ static void die_if_nologin(void) | |||
130 | fclose(fp); | 130 | fclose(fp); |
131 | } else | 131 | } else |
132 | puts("\r\nSystem closed for routine maintenance\r"); | 132 | puts("\r\nSystem closed for routine maintenance\r"); |
133 | if (!amroot) | 133 | exit(1); |
134 | exit(1); | ||
135 | puts("\r\n[Disconnect bypassed -- root login allowed]\r"); | ||
136 | } | 134 | } |
137 | #else | 135 | #else |
138 | static ALWAYS_INLINE void die_if_nologin(void) {} | 136 | static ALWAYS_INLINE void die_if_nologin(void) {} |
diff --git a/miscutils/bbconfig.c b/miscutils/bbconfig.c index ee566788b..f3aef42e3 100644 --- a/miscutils/bbconfig.c +++ b/miscutils/bbconfig.c | |||
@@ -5,7 +5,7 @@ | |||
5 | #include "bbconfigopts.h" | 5 | #include "bbconfigopts.h" |
6 | 6 | ||
7 | int bbconfig_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; | 7 | int bbconfig_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; |
8 | int bbconfig_main(int argc, char **argv) | 8 | int bbconfig_main(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED) |
9 | { | 9 | { |
10 | printf(bbconfig_config); | 10 | printf(bbconfig_config); |
11 | return 0; | 11 | return 0; |
diff --git a/miscutils/chat.c b/miscutils/chat.c index 50c5ad976..64d4ba4fd 100644 --- a/miscutils/chat.c +++ b/miscutils/chat.c | |||
@@ -233,7 +233,8 @@ int chat_main(int argc ATTRIBUTE_UNUSED, char **argv) | |||
233 | //----------------------- | 233 | //----------------------- |
234 | // do expect | 234 | // do expect |
235 | //----------------------- | 235 | //----------------------- |
236 | size_t expect_len, buf_len = 0; | 236 | int expect_len; |
237 | size_t buf_len = 0; | ||
237 | size_t max_len = max_abort_len; | 238 | size_t max_len = max_abort_len; |
238 | 239 | ||
239 | struct pollfd pfd; | 240 | struct pollfd pfd; |
@@ -315,7 +316,7 @@ int chat_main(int argc ATTRIBUTE_UNUSED, char **argv) | |||
315 | exitcode = ERR_OK; | 316 | exitcode = ERR_OK; |
316 | 317 | ||
317 | // expected reply received? -> goto next command | 318 | // expected reply received? -> goto next command |
318 | delta = buf_len-expect_len; | 319 | delta = buf_len - expect_len; |
319 | if (delta >= 0 && !memcmp(buf+delta, expect, expect_len)) | 320 | if (delta >= 0 && !memcmp(buf+delta, expect, expect_len)) |
320 | goto expect_done; | 321 | goto expect_done; |
321 | #undef buf | 322 | #undef buf |
diff --git a/modutils/insmod.c b/modutils/insmod.c index 079de6940..6274a8d15 100644 --- a/modutils/insmod.c +++ b/modutils/insmod.c | |||
@@ -3680,6 +3680,9 @@ static void check_tainted_module(struct obj_file *f, char *m_name) | |||
3680 | * start of some sections. this info is used by ksymoops to do better | 3680 | * start of some sections. this info is used by ksymoops to do better |
3681 | * debugging. | 3681 | * debugging. |
3682 | */ | 3682 | */ |
3683 | #if !ENABLE_FEATURE_INSMOD_VERSION_CHECKING | ||
3684 | #define get_module_version(f, str) get_module_version(str) | ||
3685 | #endif | ||
3683 | static int | 3686 | static int |
3684 | get_module_version(struct obj_file *f, char str[STRVERSIONLEN]) | 3687 | get_module_version(struct obj_file *f, char str[STRVERSIONLEN]) |
3685 | { | 3688 | { |
diff --git a/modutils/lsmod.c b/modutils/lsmod.c index baf0e2a9d..da8663acb 100644 --- a/modutils/lsmod.c +++ b/modutils/lsmod.c | |||
@@ -75,7 +75,7 @@ enum { | |||
75 | }; | 75 | }; |
76 | 76 | ||
77 | int lsmod_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; | 77 | int lsmod_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; |
78 | int lsmod_main(int argc, char **argv) | 78 | int lsmod_main(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED) |
79 | { | 79 | { |
80 | struct module_info info; | 80 | struct module_info info; |
81 | char *module_names, *mn, *deps, *dn; | 81 | char *module_names, *mn, *deps, *dn; |
diff --git a/networking/Kbuild b/networking/Kbuild index e06a12462..44258e9b0 100644 --- a/networking/Kbuild +++ b/networking/Kbuild | |||
@@ -17,7 +17,7 @@ lib-$(CONFIG_FTPPUT) += ftpgetput.o | |||
17 | lib-$(CONFIG_HOSTNAME) += hostname.o | 17 | lib-$(CONFIG_HOSTNAME) += hostname.o |
18 | lib-$(CONFIG_HTTPD) += httpd.o | 18 | lib-$(CONFIG_HTTPD) += httpd.o |
19 | lib-$(CONFIG_IFCONFIG) += ifconfig.o interface.o | 19 | lib-$(CONFIG_IFCONFIG) += ifconfig.o interface.o |
20 | lib-$(CONFIG_IFENSLAVE) += ifenslave.o | 20 | lib-$(CONFIG_IFENSLAVE) += ifenslave.o interface.o |
21 | lib-$(CONFIG_IFUPDOWN) += ifupdown.o | 21 | lib-$(CONFIG_IFUPDOWN) += ifupdown.o |
22 | lib-$(CONFIG_INETD) += inetd.o | 22 | lib-$(CONFIG_INETD) += inetd.o |
23 | lib-$(CONFIG_IP) += ip.o | 23 | lib-$(CONFIG_IP) += ip.o |
diff --git a/networking/ether-wake.c b/networking/ether-wake.c index b752152e1..fcd7dd2bc 100644 --- a/networking/ether-wake.c +++ b/networking/ether-wake.c | |||
@@ -179,7 +179,7 @@ static int get_wol_pw(const char *ethoptarg, unsigned char *wol_passwd) | |||
179 | } | 179 | } |
180 | 180 | ||
181 | int ether_wake_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; | 181 | int ether_wake_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; |
182 | int ether_wake_main(int argc, char **argv) | 182 | int ether_wake_main(int argc ATTRIBUTE_UNUSED, char **argv) |
183 | { | 183 | { |
184 | const char *ifname = "eth0"; | 184 | const char *ifname = "eth0"; |
185 | char *pass; | 185 | char *pass; |
diff --git a/networking/httpd.c b/networking/httpd.c index 54f288c7a..522e7eec0 100644 --- a/networking/httpd.c +++ b/networking/httpd.c | |||
@@ -1972,7 +1972,11 @@ static void handle_incoming_and_exit(const len_and_sockaddr *fromAddr) | |||
1972 | /* Try and do our best to parse more lines */ | 1972 | /* Try and do our best to parse more lines */ |
1973 | if ((STRNCASECMP(iobuf, "Content-length:") == 0)) { | 1973 | if ((STRNCASECMP(iobuf, "Content-length:") == 0)) { |
1974 | /* extra read only for POST */ | 1974 | /* extra read only for POST */ |
1975 | if (prequest != request_GET && prequest != request_HEAD) { | 1975 | if (prequest != request_GET |
1976 | #if ENABLE_FEATURE_HTTPD_CGI | ||
1977 | && prequest != request_HEAD | ||
1978 | #endif | ||
1979 | ) { | ||
1976 | tptr = iobuf + sizeof("Content-length:") - 1; | 1980 | tptr = iobuf + sizeof("Content-length:") - 1; |
1977 | if (!tptr[0]) | 1981 | if (!tptr[0]) |
1978 | send_headers_and_exit(HTTP_BAD_REQUEST); | 1982 | send_headers_and_exit(HTTP_BAD_REQUEST); |
@@ -2129,7 +2133,12 @@ static void handle_incoming_and_exit(const len_and_sockaddr *fromAddr) | |||
2129 | */ | 2133 | */ |
2130 | 2134 | ||
2131 | send_file_and_exit(tptr, | 2135 | send_file_and_exit(tptr, |
2132 | (prequest != request_HEAD ? SEND_HEADERS_AND_BODY : SEND_HEADERS)); | 2136 | #if ENABLE_FEATURE_HTTPD_CGI |
2137 | (prequest != request_HEAD ? SEND_HEADERS_AND_BODY : SEND_HEADERS) | ||
2138 | #else | ||
2139 | SEND_HEADERS_AND_BODY | ||
2140 | #endif | ||
2141 | ); | ||
2133 | } | 2142 | } |
2134 | 2143 | ||
2135 | /* | 2144 | /* |
diff --git a/networking/ifupdown.c b/networking/ifupdown.c index 6aa929a30..586c3db63 100644 --- a/networking/ifupdown.c +++ b/networking/ifupdown.c | |||
@@ -483,9 +483,9 @@ static const struct dhcp_client_t ext_dhcp_clients[] = { | |||
483 | }; | 483 | }; |
484 | #endif /* ENABLE_FEATURE_IFUPDOWN_EXTERNAL_DHCPC */ | 484 | #endif /* ENABLE_FEATURE_IFUPDOWN_EXTERNAL_DHCPC */ |
485 | 485 | ||
486 | #if ENABLE_FEATURE_IFUPDOWN_EXTERNAL_DHCP | ||
486 | static int dhcp_up(struct interface_defn_t *ifd, execfn *exec) | 487 | static int dhcp_up(struct interface_defn_t *ifd, execfn *exec) |
487 | { | 488 | { |
488 | #if ENABLE_FEATURE_IFUPDOWN_EXTERNAL_DHCP | ||
489 | int i; | 489 | int i; |
490 | #if ENABLE_FEATURE_IFUPDOWN_IP | 490 | #if ENABLE_FEATURE_IFUPDOWN_IP |
491 | /* ip doesn't up iface when it configures it (unlike ifconfig) */ | 491 | /* ip doesn't up iface when it configures it (unlike ifconfig) */ |
@@ -498,7 +498,10 @@ static int dhcp_up(struct interface_defn_t *ifd, execfn *exec) | |||
498 | } | 498 | } |
499 | bb_error_msg("no dhcp clients found"); | 499 | bb_error_msg("no dhcp clients found"); |
500 | return 0; | 500 | return 0; |
501 | } | ||
501 | #elif ENABLE_APP_UDHCPC | 502 | #elif ENABLE_APP_UDHCPC |
503 | static int dhcp_up(struct interface_defn_t *ifd, execfn *exec) | ||
504 | { | ||
502 | #if ENABLE_FEATURE_IFUPDOWN_IP | 505 | #if ENABLE_FEATURE_IFUPDOWN_IP |
503 | /* ip doesn't up iface when it configures it (unlike ifconfig) */ | 506 | /* ip doesn't up iface when it configures it (unlike ifconfig) */ |
504 | if (!execute("ip link set %iface% up", ifd, exec)) | 507 | if (!execute("ip link set %iface% up", ifd, exec)) |
@@ -507,14 +510,18 @@ static int dhcp_up(struct interface_defn_t *ifd, execfn *exec) | |||
507 | return execute("udhcpc -R -n -p /var/run/udhcpc.%iface%.pid " | 510 | return execute("udhcpc -R -n -p /var/run/udhcpc.%iface%.pid " |
508 | "-i %iface%[[ -H %hostname%]][[ -c %clientid%]][[ -s %script%]]", | 511 | "-i %iface%[[ -H %hostname%]][[ -c %clientid%]][[ -s %script%]]", |
509 | ifd, exec); | 512 | ifd, exec); |
513 | } | ||
510 | #else | 514 | #else |
515 | static int dhcp_up(struct interface_defn_t *ifd ATTRIBUTE_UNUSED, | ||
516 | execfn *exec ATTRIBUTE_UNUSED) | ||
517 | { | ||
511 | return 0; /* no dhcp support */ | 518 | return 0; /* no dhcp support */ |
512 | #endif | ||
513 | } | 519 | } |
520 | #endif | ||
514 | 521 | ||
522 | #if ENABLE_FEATURE_IFUPDOWN_EXTERNAL_DHCP | ||
515 | static int dhcp_down(struct interface_defn_t *ifd, execfn *exec) | 523 | static int dhcp_down(struct interface_defn_t *ifd, execfn *exec) |
516 | { | 524 | { |
517 | #if ENABLE_FEATURE_IFUPDOWN_EXTERNAL_DHCP | ||
518 | int i; | 525 | int i; |
519 | for (i = 0; i < ARRAY_SIZE(ext_dhcp_clients); i++) { | 526 | for (i = 0; i < ARRAY_SIZE(ext_dhcp_clients); i++) { |
520 | if (exists_execable(ext_dhcp_clients[i].name)) | 527 | if (exists_execable(ext_dhcp_clients[i].name)) |
@@ -522,13 +529,20 @@ static int dhcp_down(struct interface_defn_t *ifd, execfn *exec) | |||
522 | } | 529 | } |
523 | bb_error_msg("no dhcp clients found, using static interface shutdown"); | 530 | bb_error_msg("no dhcp clients found, using static interface shutdown"); |
524 | return static_down(ifd, exec); | 531 | return static_down(ifd, exec); |
532 | } | ||
525 | #elif ENABLE_APP_UDHCPC | 533 | #elif ENABLE_APP_UDHCPC |
534 | static int dhcp_down(struct interface_defn_t *ifd, execfn *exec) | ||
535 | { | ||
526 | return execute("kill " | 536 | return execute("kill " |
527 | "`cat /var/run/udhcpc.%iface%.pid` 2>/dev/null", ifd, exec); | 537 | "`cat /var/run/udhcpc.%iface%.pid` 2>/dev/null", ifd, exec); |
538 | } | ||
528 | #else | 539 | #else |
540 | static int dhcp_down(struct interface_defn_t *ifd ATTRIBUTE_UNUSED, | ||
541 | execfn *exec ATTRIBUTE_UNUSED) | ||
542 | { | ||
529 | return 0; /* no dhcp support */ | 543 | return 0; /* no dhcp support */ |
530 | #endif | ||
531 | } | 544 | } |
545 | #endif | ||
532 | 546 | ||
533 | static int manual_up_down(struct interface_defn_t *ifd ATTRIBUTE_UNUSED, execfn *exec ATTRIBUTE_UNUSED) | 547 | static int manual_up_down(struct interface_defn_t *ifd ATTRIBUTE_UNUSED, execfn *exec ATTRIBUTE_UNUSED) |
534 | { | 548 | { |
diff --git a/networking/inetd.c b/networking/inetd.c index 0ddfa6b45..b931aa1e0 100644 --- a/networking/inetd.c +++ b/networking/inetd.c | |||
@@ -1331,10 +1331,10 @@ int inetd_main(int argc ATTRIBUTE_UNUSED, char **argv) | |||
1331 | continue; /* -> check next fd in fd set */ | 1331 | continue; /* -> check next fd in fd set */ |
1332 | } | 1332 | } |
1333 | 1333 | ||
1334 | /* we are either child or didn't fork at all */ | 1334 | /* we are either child or didn't vfork at all */ |
1335 | #ifdef INETD_BUILTINS_ENABLED | 1335 | #ifdef INETD_BUILTINS_ENABLED |
1336 | if (sep->se_builtin) { | 1336 | if (sep->se_builtin) { |
1337 | if (pid) { /* "pid" is -1: we did fork */ | 1337 | if (pid) { /* "pid" is -1: we did vfork */ |
1338 | close(sep->se_fd); /* listening socket */ | 1338 | close(sep->se_fd); /* listening socket */ |
1339 | logmode = 0; /* make xwrite etc silent */ | 1339 | logmode = 0; /* make xwrite etc silent */ |
1340 | } | 1340 | } |
@@ -1343,8 +1343,8 @@ int inetd_main(int argc ATTRIBUTE_UNUSED, char **argv) | |||
1343 | sep->se_builtin->bi_stream_fn(ctrl, sep); | 1343 | sep->se_builtin->bi_stream_fn(ctrl, sep); |
1344 | else | 1344 | else |
1345 | sep->se_builtin->bi_dgram_fn(ctrl, sep); | 1345 | sep->se_builtin->bi_dgram_fn(ctrl, sep); |
1346 | if (pid) /* we did fork */ | 1346 | if (pid) /* we did vfork */ |
1347 | _exit(0); | 1347 | _exit(1); |
1348 | maybe_close(accepted_fd); | 1348 | maybe_close(accepted_fd); |
1349 | continue; /* -> check next fd in fd set */ | 1349 | continue; /* -> check next fd in fd set */ |
1350 | } | 1350 | } |
@@ -1430,11 +1430,15 @@ static void echo_stream(int s, servtab_t *sep ATTRIBUTE_UNUSED) | |||
1430 | xwrite(s, line, sz); | 1430 | xwrite(s, line, sz); |
1431 | } | 1431 | } |
1432 | #else | 1432 | #else |
1433 | /* We are after vfork here! */ | ||
1433 | static const char *const args[] = { "cat", NULL }; | 1434 | static const char *const args[] = { "cat", NULL }; |
1434 | /* no error messages */ | 1435 | /* move network socket to stdin */ |
1436 | xmove_fd(s, STDIN_FILENO); | ||
1437 | xdup2(STDIN_FILENO, STDOUT_FILENO); | ||
1438 | /* no error messages please... */ | ||
1435 | xmove_fd(xopen("/dev/null", O_WRONLY), STDERR_FILENO); | 1439 | xmove_fd(xopen("/dev/null", O_WRONLY), STDERR_FILENO); |
1436 | BB_EXECVP("cat", (char**)args); | 1440 | BB_EXECVP("cat", (char**)args); |
1437 | _exit(1); | 1441 | /* on failure we return to main, which does exit(1) */ |
1438 | #endif | 1442 | #endif |
1439 | } | 1443 | } |
1440 | static void echo_dg(int s, servtab_t *sep) | 1444 | static void echo_dg(int s, servtab_t *sep) |
@@ -1463,11 +1467,15 @@ static void discard_stream(int s, servtab_t *sep ATTRIBUTE_UNUSED) | |||
1463 | while (safe_read(s, line, LINE_SIZE) > 0) | 1467 | while (safe_read(s, line, LINE_SIZE) > 0) |
1464 | continue; | 1468 | continue; |
1465 | #else | 1469 | #else |
1470 | /* We are after vfork here! */ | ||
1466 | static const char *const args[] = { "dd", "of=/dev/null", NULL }; | 1471 | static const char *const args[] = { "dd", "of=/dev/null", NULL }; |
1472 | /* move network socket to stdin */ | ||
1473 | xmove_fd(s, STDIN_FILENO); | ||
1474 | xdup2(STDIN_FILENO, STDOUT_FILENO); | ||
1467 | /* no error messages */ | 1475 | /* no error messages */ |
1468 | xmove_fd(xopen("/dev/null", O_WRONLY), STDERR_FILENO); | 1476 | xmove_fd(xopen("/dev/null", O_WRONLY), STDERR_FILENO); |
1469 | BB_EXECVP("dd", (char**)args); | 1477 | BB_EXECVP("dd", (char**)args); |
1470 | _exit(1); | 1478 | /* on failure we return to main, which does exit(1) */ |
1471 | #endif | 1479 | #endif |
1472 | } | 1480 | } |
1473 | /* ARGSUSED */ | 1481 | /* ARGSUSED */ |
diff --git a/networking/nc.c b/networking/nc.c index 7c2aafaf6..7d4a6e047 100644 --- a/networking/nc.c +++ b/networking/nc.c | |||
@@ -17,7 +17,7 @@ | |||
17 | * when compared to "standard" nc | 17 | * when compared to "standard" nc |
18 | */ | 18 | */ |
19 | 19 | ||
20 | static void timeout(int signum) | 20 | static void timeout(int signum ATTRIBUTE_UNUSED) |
21 | { | 21 | { |
22 | bb_error_msg_and_die("timed out"); | 22 | bb_error_msg_and_die("timed out"); |
23 | } | 23 | } |
diff --git a/networking/sendmail.c b/networking/sendmail.c index 241028b92..2eb01dc94 100644 --- a/networking/sendmail.c +++ b/networking/sendmail.c | |||
@@ -551,11 +551,11 @@ int sendgetmail_main(int argc ATTRIBUTE_UNUSED, char **argv) | |||
551 | int rc; | 551 | int rc; |
552 | 552 | ||
553 | // retrieve message in ./tmp/ | 553 | // retrieve message in ./tmp/ |
554 | pop3_check(retr, (const char *)nmsg); | 554 | pop3_check(retr, (const char *)(ptrdiff_t)nmsg); |
555 | pop3_message(filename); | 555 | pop3_message(filename); |
556 | // delete message from server | 556 | // delete message from server |
557 | if (opts & OPTF_z) | 557 | if (opts & OPTF_z) |
558 | pop3_check("DELE %u", (const char*)nmsg); | 558 | pop3_check("DELE %u", (const char*)(ptrdiff_t)nmsg); |
559 | 559 | ||
560 | // run postprocessing program | 560 | // run postprocessing program |
561 | if (*fargs) { | 561 | if (*fargs) { |
diff --git a/networking/telnetd.c b/networking/telnetd.c index 20c57925f..2ed3b74bc 100644 --- a/networking/telnetd.c +++ b/networking/telnetd.c | |||
@@ -161,14 +161,14 @@ make_new_session( | |||
161 | const char *login_argv[2]; | 161 | const char *login_argv[2]; |
162 | struct termios termbuf; | 162 | struct termios termbuf; |
163 | int fd, pid; | 163 | int fd, pid; |
164 | char tty_name[32]; | 164 | char tty_name[GETPTY_BUFSIZE]; |
165 | struct tsession *ts = xzalloc(sizeof(struct tsession) + BUFSIZE * 2); | 165 | struct tsession *ts = xzalloc(sizeof(struct tsession) + BUFSIZE * 2); |
166 | 166 | ||
167 | /*ts->buf1 = (char *)(ts + 1);*/ | 167 | /*ts->buf1 = (char *)(ts + 1);*/ |
168 | /*ts->buf2 = ts->buf1 + BUFSIZE;*/ | 168 | /*ts->buf2 = ts->buf1 + BUFSIZE;*/ |
169 | 169 | ||
170 | /* Got a new connection, set up a tty. */ | 170 | /* Got a new connection, set up a tty. */ |
171 | fd = getpty(tty_name, 32); | 171 | fd = getpty(tty_name); |
172 | if (fd < 0) { | 172 | if (fd < 0) { |
173 | bb_error_msg("can't create pty"); | 173 | bb_error_msg("can't create pty"); |
174 | return NULL; | 174 | return NULL; |
diff --git a/networking/traceroute.c b/networking/traceroute.c index 582840af6..c0b4a3fd2 100644 --- a/networking/traceroute.c +++ b/networking/traceroute.c | |||
@@ -729,6 +729,10 @@ pr_type(unsigned char t) | |||
729 | } | 729 | } |
730 | #endif | 730 | #endif |
731 | 731 | ||
732 | #if !ENABLE_FEATURE_TRACEROUTE_VERBOSE | ||
733 | #define packet_ok(buf, cc, from, seq) \ | ||
734 | packet_ok(buf, cc, seq) | ||
735 | #endif | ||
732 | static int | 736 | static int |
733 | packet_ok(unsigned char *buf, int cc, struct sockaddr_in *from, int seq) | 737 | packet_ok(unsigned char *buf, int cc, struct sockaddr_in *from, int seq) |
734 | { | 738 | { |
diff --git a/networking/udhcp/clientsocket.c b/networking/udhcp/clientsocket.c index b5534f83e..0be661d4f 100644 --- a/networking/udhcp/clientsocket.c +++ b/networking/udhcp/clientsocket.c | |||
@@ -76,7 +76,7 @@ int raw_socket(int ifindex) | |||
76 | BPF_STMT(BPF_LD|BPF_W|BPF_IND, 0), | 76 | BPF_STMT(BPF_LD|BPF_W|BPF_IND, 0), |
77 | BPF_JUMP(BPF_JMP|BPF_JEQ|BPF_K, SERVER_AND_CLIENT_PORTS, 0, 1), /* L3, L4 */ | 77 | BPF_JUMP(BPF_JMP|BPF_JEQ|BPF_K, SERVER_AND_CLIENT_PORTS, 0, 1), /* L3, L4 */ |
78 | /* returns */ | 78 | /* returns */ |
79 | BPF_STMT(BPF_RET|BPF_K, ~0UL), /* L3: pass */ | 79 | BPF_STMT(BPF_RET|BPF_K, (~(uint32_t)0) ), /* L3: pass */ |
80 | BPF_STMT(BPF_RET|BPF_K, 0), /* L4: reject */ | 80 | BPF_STMT(BPF_RET|BPF_K, 0), /* L4: reject */ |
81 | }; | 81 | }; |
82 | static const struct sock_fprog filter_prog = { | 82 | static const struct sock_fprog filter_prog = { |
diff --git a/networking/wget.c b/networking/wget.c index dc1dc2ad9..f8adcd700 100644 --- a/networking/wget.c +++ b/networking/wget.c | |||
@@ -189,7 +189,7 @@ static void progressmeter(int flag) | |||
189 | */ | 189 | */ |
190 | #else /* FEATURE_WGET_STATUSBAR */ | 190 | #else /* FEATURE_WGET_STATUSBAR */ |
191 | 191 | ||
192 | static ALWAYS_INLINE void progressmeter(int flag) { } | 192 | static ALWAYS_INLINE void progressmeter(int flag ATTRIBUTE_UNUSED) { } |
193 | 193 | ||
194 | #endif | 194 | #endif |
195 | 195 | ||
diff --git a/procps/ps.c b/procps/ps.c index 647e03fc4..aeb8cecb4 100644 --- a/procps/ps.c +++ b/procps/ps.c | |||
@@ -484,7 +484,7 @@ int ps_main(int argc ATTRIBUTE_UNUSED, char **argv) | |||
484 | 484 | ||
485 | 485 | ||
486 | int ps_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; | 486 | int ps_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; |
487 | int ps_main(int argc, char **argv) | 487 | int ps_main(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED) |
488 | { | 488 | { |
489 | procps_status_t *p = NULL; | 489 | procps_status_t *p = NULL; |
490 | int len; | 490 | int len; |
diff --git a/shell/ash.c b/shell/ash.c index 580918ceb..d9ce202fd 100644 --- a/shell/ash.c +++ b/shell/ash.c | |||
@@ -3247,6 +3247,9 @@ static pid_t backgndpid; /* pid of last background process */ | |||
3247 | static smallint job_warning; /* user was warned about stopped jobs (can be 2, 1 or 0). */ | 3247 | static smallint job_warning; /* user was warned about stopped jobs (can be 2, 1 or 0). */ |
3248 | 3248 | ||
3249 | static struct job *makejob(/*union node *,*/ int); | 3249 | static struct job *makejob(/*union node *,*/ int); |
3250 | #if !JOBS | ||
3251 | #define forkshell(job, node, mode) forkshell(job, mode) | ||
3252 | #endif | ||
3250 | static int forkshell(struct job *, union node *, int); | 3253 | static int forkshell(struct job *, union node *, int); |
3251 | static int waitforjob(struct job *); | 3254 | static int waitforjob(struct job *); |
3252 | 3255 | ||
@@ -3424,6 +3427,9 @@ jobno(const struct job *jp) | |||
3424 | /* | 3427 | /* |
3425 | * Convert a job name to a job structure. | 3428 | * Convert a job name to a job structure. |
3426 | */ | 3429 | */ |
3430 | #if !JOBS | ||
3431 | #define getjob(name, getctl) getjob(name) | ||
3432 | #endif | ||
3427 | static struct job * | 3433 | static struct job * |
3428 | getjob(const char *name, int getctl) | 3434 | getjob(const char *name, int getctl) |
3429 | { | 3435 | { |
@@ -4533,6 +4539,9 @@ forkchild(struct job *jp, /*union node *n,*/ int mode) | |||
4533 | } | 4539 | } |
4534 | 4540 | ||
4535 | /* Called after fork(), in parent */ | 4541 | /* Called after fork(), in parent */ |
4542 | #if !JOBS | ||
4543 | #define forkparent(jp, n, mode, pid) forkparent(jp, mode, pid) | ||
4544 | #endif | ||
4536 | static void | 4545 | static void |
4537 | forkparent(struct job *jp, union node *n, int mode, pid_t pid) | 4546 | forkparent(struct job *jp, union node *n, int mode, pid_t pid) |
4538 | { | 4547 | { |
@@ -8674,8 +8683,8 @@ preadfd(void) | |||
8674 | char *buf = parsefile->buf; | 8683 | char *buf = parsefile->buf; |
8675 | parsenextc = buf; | 8684 | parsenextc = buf; |
8676 | 8685 | ||
8677 | retry: | ||
8678 | #if ENABLE_FEATURE_EDITING | 8686 | #if ENABLE_FEATURE_EDITING |
8687 | retry: | ||
8679 | if (!iflag || parsefile->fd) | 8688 | if (!iflag || parsefile->fd) |
8680 | nr = nonblock_safe_read(parsefile->fd, buf, BUFSIZ - 1); | 8689 | nr = nonblock_safe_read(parsefile->fd, buf, BUFSIZ - 1); |
8681 | else { | 8690 | else { |
@@ -8876,8 +8885,11 @@ pungetc(void) | |||
8876 | * Push a string back onto the input at this current parsefile level. | 8885 | * Push a string back onto the input at this current parsefile level. |
8877 | * We handle aliases this way. | 8886 | * We handle aliases this way. |
8878 | */ | 8887 | */ |
8888 | #if !ENABLE_ASH_ALIAS | ||
8889 | #define pushstring(s, ap) pushstring(s) | ||
8890 | #endif | ||
8879 | static void | 8891 | static void |
8880 | pushstring(char *s, void *ap) | 8892 | pushstring(char *s, struct alias *ap) |
8881 | { | 8893 | { |
8882 | struct strpush *sp; | 8894 | struct strpush *sp; |
8883 | size_t len; | 8895 | size_t len; |
@@ -8894,9 +8906,9 @@ pushstring(char *s, void *ap) | |||
8894 | sp->prevstring = parsenextc; | 8906 | sp->prevstring = parsenextc; |
8895 | sp->prevnleft = parsenleft; | 8907 | sp->prevnleft = parsenleft; |
8896 | #if ENABLE_ASH_ALIAS | 8908 | #if ENABLE_ASH_ALIAS |
8897 | sp->ap = (struct alias *)ap; | 8909 | sp->ap = ap; |
8898 | if (ap) { | 8910 | if (ap) { |
8899 | ((struct alias *)ap)->flag |= ALIASINUSE; | 8911 | ap->flag |= ALIASINUSE; |
8900 | sp->string = s; | 8912 | sp->string = s; |
8901 | } | 8913 | } |
8902 | #endif | 8914 | #endif |
diff --git a/shell/cttyhack.c b/shell/cttyhack.c index 404181720..bbe514933 100644 --- a/shell/cttyhack.c +++ b/shell/cttyhack.c | |||
@@ -38,7 +38,7 @@ struct serial_struct { | |||
38 | }; | 38 | }; |
39 | 39 | ||
40 | int cttyhack_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; | 40 | int cttyhack_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; |
41 | int cttyhack_main(int argc, char **argv) | 41 | int cttyhack_main(int argc ATTRIBUTE_UNUSED, char **argv) |
42 | { | 42 | { |
43 | int fd; | 43 | int fd; |
44 | char console[sizeof(int)*3 + 16]; | 44 | char console[sizeof(int)*3 + 16]; |
diff --git a/util-linux/fbset.c b/util-linux/fbset.c index d616abd36..ab7770d4f 100644 --- a/util-linux/fbset.c +++ b/util-linux/fbset.c | |||
@@ -170,10 +170,10 @@ enum { | |||
170 | }; | 170 | }; |
171 | #endif | 171 | #endif |
172 | 172 | ||
173 | #if ENABLE_FEATURE_FBSET_READMODE | ||
173 | static int readmode(struct fb_var_screeninfo *base, const char *fn, | 174 | static int readmode(struct fb_var_screeninfo *base, const char *fn, |
174 | const char *mode) | 175 | const char *mode) |
175 | { | 176 | { |
176 | #if ENABLE_FEATURE_FBSET_READMODE | ||
177 | FILE *f; | 177 | FILE *f; |
178 | char buf[256]; | 178 | char buf[256]; |
179 | char *p = buf; | 179 | char *p = buf; |
@@ -257,11 +257,9 @@ static int readmode(struct fb_var_screeninfo *base, const char *fn, | |||
257 | return 1; | 257 | return 1; |
258 | } | 258 | } |
259 | } | 259 | } |
260 | #else | ||
261 | bb_error_msg("mode reading not compiled in"); | ||
262 | #endif | ||
263 | return 0; | 260 | return 0; |
264 | } | 261 | } |
262 | #endif | ||
265 | 263 | ||
266 | static inline void setmode(struct fb_var_screeninfo *base, | 264 | static inline void setmode(struct fb_var_screeninfo *base, |
267 | struct fb_var_screeninfo *set) | 265 | struct fb_var_screeninfo *set) |
@@ -389,9 +387,13 @@ int fbset_main(int argc, char **argv) | |||
389 | fh = xopen(fbdev, O_RDONLY); | 387 | fh = xopen(fbdev, O_RDONLY); |
390 | xioctl(fh, FBIOGET_VSCREENINFO, &var); | 388 | xioctl(fh, FBIOGET_VSCREENINFO, &var); |
391 | if (g_options & OPT_READMODE) { | 389 | if (g_options & OPT_READMODE) { |
390 | #if !ENABLE_FEATURE_FBSET_READMODE | ||
391 | bb_show_usage(); | ||
392 | #else | ||
392 | if (!readmode(&var, modefile, mode)) { | 393 | if (!readmode(&var, modefile, mode)) { |
393 | bb_error_msg_and_die("unknown video mode '%s'", mode); | 394 | bb_error_msg_and_die("unknown video mode '%s'", mode); |
394 | } | 395 | } |
396 | #endif | ||
395 | } | 397 | } |
396 | 398 | ||
397 | setmode(&var, &varset); | 399 | setmode(&var, &varset); |
diff --git a/util-linux/fdisk.c b/util-linux/fdisk.c index a75b4f817..dcfae96f5 100644 --- a/util-linux/fdisk.c +++ b/util-linux/fdisk.c | |||
@@ -128,7 +128,11 @@ static unsigned read_int(unsigned low, unsigned dflt, unsigned high, unsigned ba | |||
128 | #endif | 128 | #endif |
129 | static const char *partition_type(unsigned char type); | 129 | static const char *partition_type(unsigned char type); |
130 | static void get_geometry(void); | 130 | static void get_geometry(void); |
131 | #if ENABLE_FEATURE_SUN_LABEL || ENABLE_FEATURE_FDISK_WRITABLE | ||
131 | static int get_boot(enum action what); | 132 | static int get_boot(enum action what); |
133 | #else | ||
134 | static int get_boot(void); | ||
135 | #endif | ||
132 | 136 | ||
133 | #define PLURAL 0 | 137 | #define PLURAL 0 |
134 | #define SINGULAR 1 | 138 | #define SINGULAR 1 |
@@ -1237,8 +1241,12 @@ get_geometry(void) | |||
1237 | * 0: found or created label | 1241 | * 0: found or created label |
1238 | * 1: I/O error | 1242 | * 1: I/O error |
1239 | */ | 1243 | */ |
1240 | static int | 1244 | #if ENABLE_FEATURE_SUN_LABEL || ENABLE_FEATURE_FDISK_WRITABLE |
1241 | get_boot(enum action what) | 1245 | static int get_boot(enum action what) |
1246 | #else | ||
1247 | static int get_boot(void) | ||
1248 | #define get_boot(what) get_boot() | ||
1249 | #endif | ||
1242 | { | 1250 | { |
1243 | int i; | 1251 | int i; |
1244 | 1252 | ||
diff --git a/util-linux/script.c b/util-linux/script.c index c37fd9d61..1c95ea550 100644 --- a/util-linux/script.c +++ b/util-linux/script.c | |||
@@ -29,7 +29,7 @@ int script_main(int argc ATTRIBUTE_UNUSED, char **argv) | |||
29 | int attr_ok; /* NB: 0: ok */ | 29 | int attr_ok; /* NB: 0: ok */ |
30 | int winsz_ok; | 30 | int winsz_ok; |
31 | int pty; | 31 | int pty; |
32 | char pty_line[32]; | 32 | char pty_line[GETPTY_BUFSIZE]; |
33 | struct termios tt, rtt; | 33 | struct termios tt, rtt; |
34 | struct winsize win; | 34 | struct winsize win; |
35 | const char *fname = "typescript"; | 35 | const char *fname = "typescript"; |
@@ -69,7 +69,7 @@ int script_main(int argc ATTRIBUTE_UNUSED, char **argv) | |||
69 | shell = DEFAULT_SHELL; | 69 | shell = DEFAULT_SHELL; |
70 | } | 70 | } |
71 | 71 | ||
72 | pty = getpty(pty_line, sizeof(pty_line)); | 72 | pty = getpty(pty_line); |
73 | if (pty < 0) { | 73 | if (pty < 0) { |
74 | bb_perror_msg_and_die("can't get pty"); | 74 | bb_perror_msg_and_die("can't get pty"); |
75 | } | 75 | } |
diff --git a/util-linux/volume_id/get_devname.c b/util-linux/volume_id/get_devname.c index 75060b0d8..af03d07a3 100644 --- a/util-linux/volume_id/get_devname.c +++ b/util-linux/volume_id/get_devname.c | |||
@@ -26,6 +26,10 @@ static struct uuidCache_s { | |||
26 | } *uuidCache; | 26 | } *uuidCache; |
27 | 27 | ||
28 | /* for now, only ext2, ext3 and xfs are supported */ | 28 | /* for now, only ext2, ext3 and xfs are supported */ |
29 | #if !ENABLE_FEATURE_VOLUMEID_ISO9660 | ||
30 | #define get_label_uuid(device, label, uuid, iso_only) \ | ||
31 | get_label_uuid(device, label, uuid) | ||
32 | #endif | ||
29 | static int | 33 | static int |
30 | get_label_uuid(const char *device, char **label, char **uuid, int iso_only) | 34 | get_label_uuid(const char *device, char **label, char **uuid, int iso_only) |
31 | { | 35 | { |
@@ -83,6 +87,10 @@ uuidcache_addentry(char * device, int major, int minor, char *label, char *uuid) | |||
83 | memcpy(last->uuid, uuid, sizeof(last->uuid)); | 87 | memcpy(last->uuid, uuid, sizeof(last->uuid)); |
84 | } | 88 | } |
85 | 89 | ||
90 | #if !ENABLE_FEATURE_VOLUMEID_ISO9660 | ||
91 | #define uuidcache_check_device(device_name, ma, mi, iso_only) \ | ||
92 | uuidcache_check_device(device_name, ma, mi) | ||
93 | #endif | ||
86 | static void | 94 | static void |
87 | uuidcache_check_device(const char *device_name, int ma, int mi, int iso_only) | 95 | uuidcache_check_device(const char *device_name, int ma, int mi, int iso_only) |
88 | { | 96 | { |