aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2009-09-23 23:15:43 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2009-09-23 23:15:43 +0200
commit606291beabab14c85a141c7a4225fbcab8d19fbd (patch)
tree4f46cd21214432feeb610e237e8dd49ef908c8f6
parent1f27ab0d4bb65425496ff4ed0fbbd0f5bb32786f (diff)
downloadbusybox-w32-606291beabab14c85a141c7a4225fbcab8d19fbd.tar.gz
busybox-w32-606291beabab14c85a141c7a4225fbcab8d19fbd.tar.bz2
busybox-w32-606291beabab14c85a141c7a4225fbcab8d19fbd.zip
*: more portability fixes by Dan Fandrich
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--archival/rpm.c4
-rw-r--r--editors/vi.c4
-rw-r--r--findutils/find.c2
-rw-r--r--libbb/vfork_daemon_rexec.c1
-rw-r--r--shell/ash.c2
-rw-r--r--shell/bbsh.c2
-rw-r--r--shell/hush.c4
-rw-r--r--sysklogd/syslogd.c1
-rw-r--r--util-linux/minix.h2
-rw-r--r--util-linux/volume_id/romfs.c2
10 files changed, 11 insertions, 13 deletions
diff --git a/archival/rpm.c b/archival/rpm.c
index 309b55a36..27c6b78a1 100644
--- a/archival/rpm.c
+++ b/archival/rpm.c
@@ -324,7 +324,7 @@ static char *rpm_getstr(int tag, int itemindex)
324 return NULL; 324 return NULL;
325 if (found[0]->type == RPM_STRING_TYPE || found[0]->type == RPM_I18NSTRING_TYPE || found[0]->type == RPM_STRING_ARRAY_TYPE) { 325 if (found[0]->type == RPM_STRING_TYPE || found[0]->type == RPM_I18NSTRING_TYPE || found[0]->type == RPM_STRING_ARRAY_TYPE) {
326 int n; 326 int n;
327 char *tmpstr = (char *) (map + found[0]->offset); 327 char *tmpstr = (char *) map + found[0]->offset;
328 for (n=0; n < itemindex; n++) 328 for (n=0; n < itemindex; n++)
329 tmpstr = tmpstr + strlen(tmpstr) + 1; 329 tmpstr = tmpstr + strlen(tmpstr) + 1;
330 return tmpstr; 330 return tmpstr;
@@ -343,7 +343,7 @@ static int rpm_getint(int tag, int itemindex)
343 if (!found || itemindex >= found[0]->count) 343 if (!found || itemindex >= found[0]->count)
344 return -1; 344 return -1;
345 345
346 tmpint = (int *) (map + found[0]->offset); 346 tmpint = (int *) ((char *) map + found[0]->offset);
347 347
348 if (found[0]->type == RPM_INT32_TYPE) { 348 if (found[0]->type == RPM_INT32_TYPE) {
349 tmpint = (int *) ((char *) tmpint + itemindex*4); 349 tmpint = (int *) ((char *) tmpint + itemindex*4);
diff --git a/editors/vi.c b/editors/vi.c
index 31a1edc9f..4decbea17 100644
--- a/editors/vi.c
+++ b/editors/vi.c
@@ -2187,11 +2187,11 @@ static void catch_sig(int sig)
2187} 2187}
2188#endif /* FEATURE_VI_USE_SIGNALS */ 2188#endif /* FEATURE_VI_USE_SIGNALS */
2189 2189
2190static int mysleep(int hund) // sleep for 'h' 1/100 seconds 2190static int mysleep(int hund) // sleep for 'hund' 1/100 seconds or stdin ready
2191{ 2191{
2192 struct pollfd pfd[1]; 2192 struct pollfd pfd[1];
2193 2193
2194 pfd[0].fd = 0; 2194 pfd[0].fd = STDIN_FILENO;
2195 pfd[0].events = POLLIN; 2195 pfd[0].events = POLLIN;
2196 return safe_poll(pfd, 1, hund*10) > 0; 2196 return safe_poll(pfd, 1, hund*10) > 0;
2197} 2197}
diff --git a/findutils/find.c b/findutils/find.c
index 76f670942..47c86be15 100644
--- a/findutils/find.c
+++ b/findutils/find.c
@@ -74,7 +74,7 @@ typedef struct {
74#endif 74#endif
75} action; 75} action;
76 76
77#define ACTS(name, arg...) typedef struct { action a; arg; } action_##name; 77#define ACTS(name, ...) typedef struct { action a; __VA_ARGS__ } action_##name;
78#define ACTF(name) \ 78#define ACTF(name) \
79 static int FAST_FUNC func_##name(const char *fileName UNUSED_PARAM, \ 79 static int FAST_FUNC func_##name(const char *fileName UNUSED_PARAM, \
80 struct stat *statbuf UNUSED_PARAM, \ 80 struct stat *statbuf UNUSED_PARAM, \
diff --git a/libbb/vfork_daemon_rexec.c b/libbb/vfork_daemon_rexec.c
index 72edfc70d..2e48e40a9 100644
--- a/libbb/vfork_daemon_rexec.c
+++ b/libbb/vfork_daemon_rexec.c
@@ -15,7 +15,6 @@
15 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. 15 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
16 */ 16 */
17 17
18#include <paths.h>
19#include "busybox.h" /* uses applet tables */ 18#include "busybox.h" /* uses applet tables */
20 19
21/* This does a fork/exec in one call, using vfork(). Returns PID of new child, 20/* This does a fork/exec in one call, using vfork(). Returns PID of new child,
diff --git a/shell/ash.c b/shell/ash.c
index db28af7d3..b7c643195 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -5042,7 +5042,7 @@ struct redirtab {
5042 struct redirtab *next; 5042 struct redirtab *next;
5043 int nullredirs; 5043 int nullredirs;
5044 int pair_count; 5044 int pair_count;
5045 struct two_fd_t two_fd[0]; 5045 struct two_fd_t two_fd[];
5046}; 5046};
5047#define redirlist (G_var.redirlist) 5047#define redirlist (G_var.redirlist)
5048 5048
diff --git a/shell/bbsh.c b/shell/bbsh.c
index ad875abf5..c3726263a 100644
--- a/shell/bbsh.c
+++ b/shell/bbsh.c
@@ -54,7 +54,7 @@ struct command {
54 int flags; // exit, suspend, && || 54 int flags; // exit, suspend, && ||
55 int pid; // pid (or exit code) 55 int pid; // pid (or exit code)
56 int argc; 56 int argc;
57 char *argv[0]; 57 char *argv[];
58}; 58};
59 59
60// A collection of processes piped into/waiting on each other. 60// A collection of processes piped into/waiting on each other.
diff --git a/shell/hush.c b/shell/hush.c
index eaf911458..9db2091dd 100644
--- a/shell/hush.c
+++ b/shell/hush.c
@@ -787,7 +787,7 @@ static void xxfree(void *ptr)
787 * HUSH_DEBUG >= 2 prints line number in this file where it was detected. 787 * HUSH_DEBUG >= 2 prints line number in this file where it was detected.
788 */ 788 */
789#if HUSH_DEBUG < 2 789#if HUSH_DEBUG < 2
790# define die_if_script(lineno, fmt...) die_if_script(fmt) 790# define die_if_script(lineno, ...) die_if_script(__VA_ARGS__)
791# define syntax_error(lineno, msg) syntax_error(msg) 791# define syntax_error(lineno, msg) syntax_error(msg)
792# define syntax_error_at(lineno, msg) syntax_error_at(msg) 792# define syntax_error_at(lineno, msg) syntax_error_at(msg)
793# define syntax_error_unterm_ch(lineno, ch) syntax_error_unterm_ch(ch) 793# define syntax_error_unterm_ch(lineno, ch) syntax_error_unterm_ch(ch)
@@ -856,7 +856,7 @@ static void syntax_error_unexpected_ch(unsigned lineno, int ch)
856# undef syntax_error_unterm_str 856# undef syntax_error_unterm_str
857# undef syntax_error_unexpected_ch 857# undef syntax_error_unexpected_ch
858#else 858#else
859# define die_if_script(fmt...) die_if_script(__LINE__, fmt) 859# define die_if_script(...) die_if_script(__LINE__, __VA_ARGS__)
860# define syntax_error(msg) syntax_error(__LINE__, msg) 860# define syntax_error(msg) syntax_error(__LINE__, msg)
861# define syntax_error_at(msg) syntax_error_at(__LINE__, msg) 861# define syntax_error_at(msg) syntax_error_at(__LINE__, msg)
862# define syntax_error_unterm_ch(ch) syntax_error_unterm_ch(__LINE__, ch) 862# define syntax_error_unterm_ch(ch) syntax_error_unterm_ch(__LINE__, ch)
diff --git a/sysklogd/syslogd.c b/sysklogd/syslogd.c
index 90866c8a8..754fa44b3 100644
--- a/sysklogd/syslogd.c
+++ b/sysklogd/syslogd.c
@@ -21,7 +21,6 @@
21#include <syslog.h> 21#include <syslog.h>
22*/ 22*/
23 23
24#include <paths.h>
25#include <sys/un.h> 24#include <sys/un.h>
26#include <sys/uio.h> 25#include <sys/uio.h>
27 26
diff --git a/util-linux/minix.h b/util-linux/minix.h
index 3e2b989e3..e0fbcf761 100644
--- a/util-linux/minix.h
+++ b/util-linux/minix.h
@@ -48,7 +48,7 @@ struct minix_superblock {
48 48
49struct minix_dir_entry { 49struct minix_dir_entry {
50 uint16_t inode; 50 uint16_t inode;
51 char name[0]; 51 char name[];
52}; 52};
53 53
54/* Believe it or not, but mount.h has this one #defined */ 54/* Believe it or not, but mount.h has this one #defined */
diff --git a/util-linux/volume_id/romfs.c b/util-linux/volume_id/romfs.c
index 4ed13191e..f5005cd50 100644
--- a/util-linux/volume_id/romfs.c
+++ b/util-linux/volume_id/romfs.c
@@ -24,7 +24,7 @@ struct romfs_super {
24 uint8_t magic[8]; 24 uint8_t magic[8];
25 uint32_t size; 25 uint32_t size;
26 uint32_t checksum; 26 uint32_t checksum;
27 uint8_t name[0]; 27 uint8_t name[];
28} PACKED; 28} PACKED;
29 29
30int volume_id_probe_romfs(struct volume_id *id /*,uint64_t off*/) 30int volume_id_probe_romfs(struct volume_id *id /*,uint64_t off*/)