aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErik Andersen <andersen@codepoet.org>2000-05-20 00:40:08 +0000
committerErik Andersen <andersen@codepoet.org>2000-05-20 00:40:08 +0000
commit8ea7d8cdaf4a03cdc06abc8b752b589271140a88 (patch)
tree955fc9545f490ca39f0c24629316b7d328612802
parent330fd2b5767110f29544131d4c72c77e0506b6df (diff)
downloadbusybox-w32-8ea7d8cdaf4a03cdc06abc8b752b589271140a88.tar.gz
busybox-w32-8ea7d8cdaf4a03cdc06abc8b752b589271140a88.tar.bz2
busybox-w32-8ea7d8cdaf4a03cdc06abc8b752b589271140a88.zip
First pass at fixing tar segfault, and more portability updates.
-Erik
-rw-r--r--TODO5
-rw-r--r--archival/tar.c5
-rw-r--r--cmdedit.c6
-rw-r--r--fsck_minix.c1
-rw-r--r--internal.h12
-rw-r--r--mkfs_minix.c5
-rw-r--r--shell/cmdedit.c6
-rw-r--r--tar.c5
-rw-r--r--util-linux/fsck_minix.c1
-rw-r--r--util-linux/mkfs_minix.c5
10 files changed, 27 insertions, 24 deletions
diff --git a/TODO b/TODO
index 7ab43c36d..febd9bf51 100644
--- a/TODO
+++ b/TODO
@@ -22,6 +22,11 @@ Bugs that need fixing:
22 - 'grep *foo file' segfaults 22 - 'grep *foo file' segfaults
23 - ps dirent race bug (need to stat the file before attempting chdir) 23 - ps dirent race bug (need to stat the file before attempting chdir)
24 24
25
26/busybox tar tvf
27Segmentation fault (core dumped)
28
29
25----------- 30-----------
26 31
27* Make insmod actually work 32* Make insmod actually work
diff --git a/archival/tar.c b/archival/tar.c
index 6784d80ff..c5aad45d6 100644
--- a/archival/tar.c
+++ b/archival/tar.c
@@ -185,7 +185,7 @@ extern int tar_main(int argc, char **argv)
185 usage(tar_usage); 185 usage(tar_usage);
186 186
187 /* Parse any options */ 187 /* Parse any options */
188 while (--argc > 0 && **(++argv) == '-') { 188 while (--argc > 0 && strspn(*(++argv), "-cxt") >0 ) {
189 stopIt=FALSE; 189 stopIt=FALSE;
190 while (stopIt==FALSE && *(++(*argv))) { 190 while (stopIt==FALSE && *(++(*argv))) {
191 switch (**argv) { 191 switch (**argv) {
@@ -265,7 +265,8 @@ extern int tar_main(int argc, char **argv)
265#else 265#else
266 exit(writeTarFile(tarName, tostdoutFlag, verboseFlag, argc, argv, excludeList)); 266 exit(writeTarFile(tarName, tostdoutFlag, verboseFlag, argc, argv, excludeList));
267#endif 267#endif
268 } else { 268 }
269 if (listFlag == TRUE || extractFlag == TRUE) {
269 exit(readTarFile(tarName, extractFlag, listFlag, tostdoutFlag, verboseFlag, excludeList)); 270 exit(readTarFile(tarName, extractFlag, listFlag, tostdoutFlag, verboseFlag, excludeList));
270 } 271 }
271 272
diff --git a/cmdedit.c b/cmdedit.c
index e4c88c265..22831b10c 100644
--- a/cmdedit.c
+++ b/cmdedit.c
@@ -70,6 +70,12 @@ static struct history *his_end = NULL; /* Last element in command line list */
70 70
71/* Current termio and the previous termio before starting sh */ 71/* Current termio and the previous termio before starting sh */
72struct termios initial_settings, new_settings; 72struct termios initial_settings, new_settings;
73
74
75#ifndef _POSIX_VDISABLE
76#define _POSIX_VDISABLE '\0'
77#endif
78
73#endif 79#endif
74 80
75 81
diff --git a/fsck_minix.c b/fsck_minix.c
index 7d27566b8..1e482f3f9 100644
--- a/fsck_minix.c
+++ b/fsck_minix.c
@@ -97,6 +97,7 @@
97#include <termios.h> 97#include <termios.h>
98#include <mntent.h> 98#include <mntent.h>
99#include <sys/stat.h> 99#include <sys/stat.h>
100#include <sys/param.h>
100 101
101#include <linux/fs.h> 102#include <linux/fs.h>
102#include <linux/minix_fs.h> 103#include <linux/minix_fs.h>
diff --git a/internal.h b/internal.h
index 9c55f5a49..909bf6473 100644
--- a/internal.h
+++ b/internal.h
@@ -284,18 +284,6 @@ int nfsmount(const char *spec, const char *node, unsigned long *flags,
284 char **extra_opts, char **mount_opts, int running_bg); 284 char **extra_opts, char **mount_opts, int running_bg);
285#endif 285#endif
286 286
287#if defined (BB_FSCK_MINIX) || defined (BB_MKFS_MINIX)
288/* Bit map related macros. */
289#ifndef setbit
290#define CHAR_BITS 8 /* Number of bits in a `char'. */
291#define setbit(a,i) ((a)[(i)/CHAR_BITS] |= 1<<((i)%CHAR_BITS))
292#define clrbit(a,i) ((a)[(i)/CHAR_BITS] &= ~(1<<((i)%CHAR_BITS)))
293#define isset(a,i) ((a)[(i)/CHAR_BITS] & (1<<((i)%CHAR_BITS)))
294#define isclr(a,i) (((a)[(i)/CHAR_BITS] & (1<<((i)%CHAR_BITS))) == 0)
295#endif
296#endif
297
298
299#ifndef RB_POWER_OFF 287#ifndef RB_POWER_OFF
300/* Stop system and switch power off if possable. */ 288/* Stop system and switch power off if possable. */
301#define RB_POWER_OFF 0x4321fedc 289#define RB_POWER_OFF 0x4321fedc
diff --git a/mkfs_minix.c b/mkfs_minix.c
index f4f1d0997..c6f057a07 100644
--- a/mkfs_minix.c
+++ b/mkfs_minix.c
@@ -74,6 +74,7 @@
74#include <termios.h> 74#include <termios.h>
75#include <sys/stat.h> 75#include <sys/stat.h>
76#include <sys/ioctl.h> 76#include <sys/ioctl.h>
77#include <sys/param.h>
77#include <mntent.h> 78#include <mntent.h>
78 79
79#include <linux/fs.h> 80#include <linux/fs.h>
@@ -83,10 +84,6 @@
83#define HAVE_MINIX2 1 84#define HAVE_MINIX2 1
84#endif 85#endif
85 86
86#ifndef __GNUC__
87#error "needs gcc for the bitop-__asm__'s"
88#endif
89
90#ifndef __linux__ 87#ifndef __linux__
91#define volatile 88#define volatile
92#endif 89#endif
diff --git a/shell/cmdedit.c b/shell/cmdedit.c
index e4c88c265..22831b10c 100644
--- a/shell/cmdedit.c
+++ b/shell/cmdedit.c
@@ -70,6 +70,12 @@ static struct history *his_end = NULL; /* Last element in command line list */
70 70
71/* Current termio and the previous termio before starting sh */ 71/* Current termio and the previous termio before starting sh */
72struct termios initial_settings, new_settings; 72struct termios initial_settings, new_settings;
73
74
75#ifndef _POSIX_VDISABLE
76#define _POSIX_VDISABLE '\0'
77#endif
78
73#endif 79#endif
74 80
75 81
diff --git a/tar.c b/tar.c
index 6784d80ff..c5aad45d6 100644
--- a/tar.c
+++ b/tar.c
@@ -185,7 +185,7 @@ extern int tar_main(int argc, char **argv)
185 usage(tar_usage); 185 usage(tar_usage);
186 186
187 /* Parse any options */ 187 /* Parse any options */
188 while (--argc > 0 && **(++argv) == '-') { 188 while (--argc > 0 && strspn(*(++argv), "-cxt") >0 ) {
189 stopIt=FALSE; 189 stopIt=FALSE;
190 while (stopIt==FALSE && *(++(*argv))) { 190 while (stopIt==FALSE && *(++(*argv))) {
191 switch (**argv) { 191 switch (**argv) {
@@ -265,7 +265,8 @@ extern int tar_main(int argc, char **argv)
265#else 265#else
266 exit(writeTarFile(tarName, tostdoutFlag, verboseFlag, argc, argv, excludeList)); 266 exit(writeTarFile(tarName, tostdoutFlag, verboseFlag, argc, argv, excludeList));
267#endif 267#endif
268 } else { 268 }
269 if (listFlag == TRUE || extractFlag == TRUE) {
269 exit(readTarFile(tarName, extractFlag, listFlag, tostdoutFlag, verboseFlag, excludeList)); 270 exit(readTarFile(tarName, extractFlag, listFlag, tostdoutFlag, verboseFlag, excludeList));
270 } 271 }
271 272
diff --git a/util-linux/fsck_minix.c b/util-linux/fsck_minix.c
index 7d27566b8..1e482f3f9 100644
--- a/util-linux/fsck_minix.c
+++ b/util-linux/fsck_minix.c
@@ -97,6 +97,7 @@
97#include <termios.h> 97#include <termios.h>
98#include <mntent.h> 98#include <mntent.h>
99#include <sys/stat.h> 99#include <sys/stat.h>
100#include <sys/param.h>
100 101
101#include <linux/fs.h> 102#include <linux/fs.h>
102#include <linux/minix_fs.h> 103#include <linux/minix_fs.h>
diff --git a/util-linux/mkfs_minix.c b/util-linux/mkfs_minix.c
index f4f1d0997..c6f057a07 100644
--- a/util-linux/mkfs_minix.c
+++ b/util-linux/mkfs_minix.c
@@ -74,6 +74,7 @@
74#include <termios.h> 74#include <termios.h>
75#include <sys/stat.h> 75#include <sys/stat.h>
76#include <sys/ioctl.h> 76#include <sys/ioctl.h>
77#include <sys/param.h>
77#include <mntent.h> 78#include <mntent.h>
78 79
79#include <linux/fs.h> 80#include <linux/fs.h>
@@ -83,10 +84,6 @@
83#define HAVE_MINIX2 1 84#define HAVE_MINIX2 1
84#endif 85#endif
85 86
86#ifndef __GNUC__
87#error "needs gcc for the bitop-__asm__'s"
88#endif
89
90#ifndef __linux__ 87#ifndef __linux__
91#define volatile 88#define volatile
92#endif 89#endif