diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2008-06-23 22:31:52 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2008-06-23 22:31:52 +0000 |
commit | cc3f20b9bdf9a46c41877dab4900eb2997b72019 (patch) | |
tree | 4447fc490a0f65921d5c324283da20c837121535 | |
parent | 211b59be431350b2cc6685f5365ad5e6b597dc18 (diff) | |
download | busybox-w32-cc3f20b9bdf9a46c41877dab4900eb2997b72019.tar.gz busybox-w32-cc3f20b9bdf9a46c41877dab4900eb2997b72019.tar.bz2 busybox-w32-cc3f20b9bdf9a46c41877dab4900eb2997b72019.zip |
fix breakage found by randomconfig
-rw-r--r-- | Config.in | 4 | ||||
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | coreutils/ls.c | 4 | ||||
-rw-r--r-- | editors/diff.c | 4 | ||||
-rw-r--r-- | libbb/Kbuild | 6 | ||||
-rw-r--r-- | shell/ash.c | 2 | ||||
-rw-r--r-- | shell/hush.c | 13 |
7 files changed, 20 insertions, 15 deletions
@@ -293,10 +293,12 @@ config NOMMU | |||
293 | 293 | ||
294 | Most people will leave this set to 'N'. | 294 | Most people will leave this set to 'N'. |
295 | 295 | ||
296 | # PIE can be made to work with BUILD_LIBBUSYBOX, but currently | ||
297 | # build system does not support that | ||
296 | config BUILD_LIBBUSYBOX | 298 | config BUILD_LIBBUSYBOX |
297 | bool "Build shared libbusybox" | 299 | bool "Build shared libbusybox" |
298 | default n | 300 | default n |
299 | depends on !FEATURE_PREFER_APPLETS | 301 | depends on !FEATURE_PREFER_APPLETS && !PIE |
300 | help | 302 | help |
301 | Build a shared library libbusybox.so.N.N.N which contains all | 303 | Build a shared library libbusybox.so.N.N.N which contains all |
302 | busybox code. | 304 | busybox code. |
@@ -698,6 +698,8 @@ ifeq ($(SKIP_STRIP),y) | |||
698 | else | 698 | else |
699 | $(Q)$(STRIP) -s --remove-section=.note --remove-section=.comment \ | 699 | $(Q)$(STRIP) -s --remove-section=.note --remove-section=.comment \ |
700 | busybox_unstripped -o $@ | 700 | busybox_unstripped -o $@ |
701 | # strip is confused by PIE executable and does not set exec bits | ||
702 | $(Q)chmod a+x $@ | ||
701 | endif | 703 | endif |
702 | 704 | ||
703 | # The actual objects are generated when descending, | 705 | # The actual objects are generated when descending, |
diff --git a/coreutils/ls.c b/coreutils/ls.c index 56be12a64..83ad8cd00 100644 --- a/coreutils/ls.c +++ b/coreutils/ls.c | |||
@@ -171,8 +171,8 @@ enum { | |||
171 | /* memset: we have to zero it out because of NOEXEC */ | 171 | /* memset: we have to zero it out because of NOEXEC */ |
172 | #define INIT_G() { \ | 172 | #define INIT_G() { \ |
173 | memset(&G, 0, sizeof(G)); \ | 173 | memset(&G, 0, sizeof(G)); \ |
174 | tabstops = COLUMN_GAP; \ | 174 | USE_FEATURE_AUTOWIDTH(tabstops = COLUMN_GAP;) \ |
175 | terminal_width = TERMINAL_WIDTH; \ | 175 | USE_FEATURE_AUTOWIDTH(terminal_width = TERMINAL_WIDTH;) \ |
176 | USE_FEATURE_LS_TIMESTAMPS(time(¤t_time_t);) \ | 176 | USE_FEATURE_LS_TIMESTAMPS(time(¤t_time_t);) \ |
177 | } | 177 | } |
178 | 178 | ||
diff --git a/editors/diff.c b/editors/diff.c index 26f352780..ad089e2a6 100644 --- a/editors/diff.c +++ b/editors/diff.c | |||
@@ -161,14 +161,14 @@ struct globals { | |||
161 | } while (0) | 161 | } while (0) |
162 | 162 | ||
163 | 163 | ||
164 | /*static void print_only(const char *path, size_t dirlen, const char *entry)*/ | 164 | #if ENABLE_FEATURE_DIFF_DIR |
165 | static void print_only(const char *path, const char *entry) | 165 | static void print_only(const char *path, const char *entry) |
166 | { | 166 | { |
167 | printf("Only in %s: %s\n", path, entry); | 167 | printf("Only in %s: %s\n", path, entry); |
168 | } | 168 | } |
169 | #endif | ||
169 | 170 | ||
170 | 171 | ||
171 | /*static void print_status(int val, char *path1, char *path2, char *entry)*/ | ||
172 | static void print_status(int val, char *_path1, char *_path2) | 172 | static void print_status(int val, char *_path1, char *_path2) |
173 | { | 173 | { |
174 | /*const char *const _entry = entry ? entry : "";*/ | 174 | /*const char *const _entry = entry ? entry : "";*/ |
diff --git a/libbb/Kbuild b/libbb/Kbuild index 7bb0f3bfe..5cbecd537 100644 --- a/libbb/Kbuild +++ b/libbb/Kbuild | |||
@@ -119,9 +119,9 @@ lib-$(CONFIG_CHPASSWD) += pw_encrypt.o crypt_make_salt.o update_passwd.o | |||
119 | lib-$(CONFIG_CRYPTPW) += pw_encrypt.o crypt_make_salt.o | 119 | lib-$(CONFIG_CRYPTPW) += pw_encrypt.o crypt_make_salt.o |
120 | lib-$(CONFIG_SULOGIN) += pw_encrypt.o | 120 | lib-$(CONFIG_SULOGIN) += pw_encrypt.o |
121 | lib-$(CONFIG_FEATURE_HTTPD_AUTH_MD5) += pw_encrypt.o | 121 | lib-$(CONFIG_FEATURE_HTTPD_AUTH_MD5) += pw_encrypt.o |
122 | lib-$(CONFIG_VLOCK) += correct_password.o | 122 | lib-$(CONFIG_VLOCK) += pw_encrypt.o correct_password.o |
123 | lib-$(CONFIG_SU) += correct_password.o | 123 | lib-$(CONFIG_SU) += pw_encrypt.o correct_password.o |
124 | lib-$(CONFIG_LOGIN) += correct_password.o | 124 | lib-$(CONFIG_LOGIN) += pw_encrypt.o correct_password.o |
125 | lib-$(CONFIG_DF) += find_mount_point.o | 125 | lib-$(CONFIG_DF) += find_mount_point.o |
126 | lib-$(CONFIG_MKFS_MINIX) += find_mount_point.o | 126 | lib-$(CONFIG_MKFS_MINIX) += find_mount_point.o |
127 | lib-$(CONFIG_SELINUX) += selinux_common.o | 127 | lib-$(CONFIG_SELINUX) += selinux_common.o |
diff --git a/shell/ash.c b/shell/ash.c index d4da391a0..dd20fe338 100644 --- a/shell/ash.c +++ b/shell/ash.c | |||
@@ -8983,7 +8983,7 @@ preadfd(void) | |||
8983 | } | 8983 | } |
8984 | } | 8984 | } |
8985 | #else | 8985 | #else |
8986 | nr = nonblock_safe_read(parsefile->fd, buf, BUFSIZ - 1); | 8986 | nr = nonblock_safe_read(g_parsefile->fd, buf, BUFSIZ - 1); |
8987 | #endif | 8987 | #endif |
8988 | 8988 | ||
8989 | #if 0 | 8989 | #if 0 |
diff --git a/shell/hush.c b/shell/hush.c index 02eae7d5b..01c9dc8ef 100644 --- a/shell/hush.c +++ b/shell/hush.c | |||
@@ -399,11 +399,11 @@ struct globals { | |||
399 | #if ENABLE_FEATURE_EDITING | 399 | #if ENABLE_FEATURE_EDITING |
400 | line_input_t *line_input_state; | 400 | line_input_t *line_input_state; |
401 | #endif | 401 | #endif |
402 | pid_t root_pid; | ||
402 | #if ENABLE_HUSH_JOB | 403 | #if ENABLE_HUSH_JOB |
403 | int run_list_level; | 404 | int run_list_level; |
404 | pid_t saved_task_pgrp; | 405 | pid_t saved_task_pgrp; |
405 | pid_t saved_tty_pgrp; | 406 | pid_t saved_tty_pgrp; |
406 | pid_t root_pid; | ||
407 | int last_jobid; | 407 | int last_jobid; |
408 | struct pipe *job_list; | 408 | struct pipe *job_list; |
409 | struct pipe *toplevel_list; | 409 | struct pipe *toplevel_list; |
@@ -446,11 +446,11 @@ enum { run_list_level = 0 }; | |||
446 | #if ENABLE_FEATURE_EDITING | 446 | #if ENABLE_FEATURE_EDITING |
447 | #define line_input_state (G.line_input_state) | 447 | #define line_input_state (G.line_input_state) |
448 | #endif | 448 | #endif |
449 | #define root_pid (G.root_pid ) | ||
449 | #if ENABLE_HUSH_JOB | 450 | #if ENABLE_HUSH_JOB |
450 | #define run_list_level (G.run_list_level ) | 451 | #define run_list_level (G.run_list_level ) |
451 | #define saved_task_pgrp (G.saved_task_pgrp ) | 452 | #define saved_task_pgrp (G.saved_task_pgrp ) |
452 | #define saved_tty_pgrp (G.saved_tty_pgrp ) | 453 | #define saved_tty_pgrp (G.saved_tty_pgrp ) |
453 | #define root_pid (G.root_pid ) | ||
454 | #define last_jobid (G.last_jobid ) | 454 | #define last_jobid (G.last_jobid ) |
455 | #define job_list (G.job_list ) | 455 | #define job_list (G.job_list ) |
456 | #define toplevel_list (G.toplevel_list ) | 456 | #define toplevel_list (G.toplevel_list ) |
@@ -1065,7 +1065,7 @@ static int o_save_ptr_helper(o_string *o, int n) | |||
1065 | debug_printf_list("list[%d]=%d string_start=%d (empty slot)\n", n, string_len, string_start); | 1065 | debug_printf_list("list[%d]=%d string_start=%d (empty slot)\n", n, string_len, string_start); |
1066 | o->has_empty_slot = 0; | 1066 | o->has_empty_slot = 0; |
1067 | } | 1067 | } |
1068 | list[n] = (char*)string_len; | 1068 | list[n] = (char*)(ptrdiff_t)string_len; |
1069 | return n + 1; | 1069 | return n + 1; |
1070 | } | 1070 | } |
1071 | 1071 | ||
@@ -1075,7 +1075,7 @@ static int o_get_last_ptr(o_string *o, int n) | |||
1075 | char **list = (char**)o->data; | 1075 | char **list = (char**)o->data; |
1076 | int string_start = ((n + 0xf) & ~0xf) * sizeof(list[0]); | 1076 | int string_start = ((n + 0xf) & ~0xf) * sizeof(list[0]); |
1077 | 1077 | ||
1078 | return ((int)list[n-1]) + string_start; | 1078 | return ((int)(ptrdiff_t)list[n-1]) + string_start; |
1079 | } | 1079 | } |
1080 | 1080 | ||
1081 | /* o_glob performs globbing on last list[], saving each result | 1081 | /* o_glob performs globbing on last list[], saving each result |
@@ -1152,7 +1152,7 @@ static char **o_finalize_list(o_string *o, int n) | |||
1152 | list[--n] = NULL; | 1152 | list[--n] = NULL; |
1153 | while (n) { | 1153 | while (n) { |
1154 | n--; | 1154 | n--; |
1155 | list[n] = o->data + (int)list[n] + string_start; | 1155 | list[n] = o->data + (int)(ptrdiff_t)list[n] + string_start; |
1156 | } | 1156 | } |
1157 | return list; | 1157 | return list; |
1158 | } | 1158 | } |
@@ -2012,6 +2012,7 @@ static int run_list(struct pipe *pi) | |||
2012 | #else | 2012 | #else |
2013 | enum { if_code = 0, next_if_code = 0 }; | 2013 | enum { if_code = 0, next_if_code = 0 }; |
2014 | #endif | 2014 | #endif |
2015 | // TODO: rword and ->res_word are not needed if !LOOPS and !IF | ||
2015 | reserved_style rword; | 2016 | reserved_style rword; |
2016 | reserved_style skip_more_for_this_rword = RES_XXXX; | 2017 | reserved_style skip_more_for_this_rword = RES_XXXX; |
2017 | 2018 | ||
@@ -3009,7 +3010,7 @@ static void done_pipe(struct p_context *ctx, pipe_style type) | |||
3009 | * IOW: it is safe to do it unconditionally. | 3010 | * IOW: it is safe to do it unconditionally. |
3010 | * RES_IN case is for "for a in; do ..." (empty IN set) | 3011 | * RES_IN case is for "for a in; do ..." (empty IN set) |
3011 | * to work. */ | 3012 | * to work. */ |
3012 | if (not_null || ctx->pipe->res_word == RES_IN) { | 3013 | if (not_null USE_HUSH_LOOPS(|| ctx->pipe->res_word == RES_IN)) { |
3013 | struct pipe *new_p = new_pipe(); | 3014 | struct pipe *new_p = new_pipe(); |
3014 | ctx->pipe->next = new_p; | 3015 | ctx->pipe->next = new_p; |
3015 | ctx->pipe = new_p; | 3016 | ctx->pipe = new_p; |