imported brians code
[nestedvm.git] / upstream / patches / busybox.patch
1 Only in .: BusyBox.class
2 Only in .: BusyBox.java
3 diff -ur ../busybox-0.60.5/Config.h ./Config.h
4 --- ../busybox-0.60.5/Config.h  Tue Sep 17 18:04:28 2002
5 +++ ./Config.h  Tue Nov 25 11:05:07 2003
6 @@ -12,95 +12,95 @@
7  #define BB_ASH
8  #define BB_BASENAME
9  #define BB_CAT
10 -#define BB_CHGRP
11 -#define BB_CHMOD
12 -#define BB_CHOWN
13 -#define BB_CHROOT
14 -#define BB_CHVT
15 +//#define BB_CHGRP
16 +//#define BB_CHMOD
17 +//#define BB_CHOWN
18 +//#define BB_CHROOT
19 +//#define BB_CHVT
20  #define BB_CLEAR
21 -//#define BB_CMP
22 -#define BB_CP
23 +#define BB_CMP
24 +//#define BB_CP
25  //#define BB_CPIO
26  #define BB_CUT
27  #define BB_DATE
28  //#define BB_DC
29 -#define BB_DD
30 +//#define BB_DD
31  //#define BB_DEALLOCVT
32 -#define BB_DF
33 +//#define BB_DF
34  #define BB_DIRNAME
35 -#define BB_DMESG
36 +//#define BB_DMESG
37  //#define BB_DOS2UNIX
38  //#define BB_DPKG
39  //#define BB_DPKG_DEB
40  //#define BB_DUTMP
41 -#define BB_DU
42 +//#define BB_DU
43  //#define BB_DUMPKMAP
44  #define BB_ECHO
45 -#define BB_ENV
46 +//#define BB_ENV
47  //#define BB_EXPR
48  //#define BB_FBSET
49  //#define BB_FDFLUSH
50 -#define BB_FIND
51 -#define BB_FREE
52 +//#define BB_FIND
53 +//#define BB_FREE
54  //#define BB_FREERAMDISK
55  //#define BB_FSCK_MINIX
56  //#define BB_GETOPT
57  #define BB_GREP
58 -#define BB_GUNZIP
59 +//#define BB_GUNZIP
60  #define BB_GZIP
61 -#define BB_HALT
62 +//#define BB_HALT
63  #define BB_HEAD
64  //#define BB_HOSTID
65  //#define BB_HOSTNAME
66  //#define BB_HUSH
67 -#define BB_ID
68 +//#define BB_ID
69  //#define BB_IFCONFIG
70 -#define BB_INIT
71 +//#define BB_INIT
72  //#define BB_INSMOD
73 -#define BB_KILL
74 -#define BB_KILLALL
75 -#define BB_KLOGD
76 +//#define BB_KILL
77 +//#define BB_KILLALL
78 +//#define BB_KLOGD
79  //#define BB_LASH
80  //#define BB_LENGTH
81 -#define BB_LN
82 +//#define BB_LN
83  //#define BB_LOADACM
84  //#define BB_LOADFONT
85  //#define BB_LOADKMAP
86 -#define BB_LOGGER
87 +//#define BB_LOGGER
88  //#define BB_LOGNAME
89  //#define BB_LOSETUP
90  #define BB_LS
91 -#define BB_LSMOD
92 +//#define BB_LSMOD
93  //#define BB_MAKEDEVS
94 -//#define BB_MD5SUM
95 +#define BB_MD5SUM
96  #define BB_MKDIR
97  //#define BB_MKFIFO
98  //#define BB_MKFS_MINIX
99 -#define BB_MKNOD
100 -#define BB_MKSWAP
101 +//#define BB_MKNOD
102 +//#define BB_MKSWAP
103  //#define BB_MKTEMP
104 -#define BB_MODPROBE
105 -#define BB_MORE
106 -#define BB_MOUNT
107 +//#define BB_MODPROBE
108 +//#define BB_MORE
109 +//#define BB_MOUNT
110  //#define BB_MSH
111  //#define BB_MT
112 -#define BB_MV
113 +//#define BB_MV
114  //#define BB_NC
115  //#define BB_NSLOOKUP
116 -#define BB_PIDOF
117 +//#define BB_PIDOF
118  //#define BB_PING
119  //#define BB_PIVOT_ROOT
120 -#define BB_POWEROFF
121 -//#define BB_PRINTF
122 -#define BB_PS
123 -#define BB_PWD
124 +//#define BB_POWEROFF
125 +#define BB_PRINTF
126 +//#define BB_PS
127 +//#define BB_PWD
128  //#define BB_RDATE
129  //#define BB_READLINK
130 -#define BB_REBOOT
131 +//#define BB_REBOOT
132  //#define BB_RENICE
133  #define BB_RESET
134 -#define BB_RM
135 -#define BB_RMDIR
136 +//#define BB_RM
137 +//#define BB_RMDIR
138  //#define BB_RMMOD
139  //#define BB_ROUTE
140  //#define BB_RPM2CPIO
141 @@ -109,13 +109,13 @@
142  #define BB_SLEEP
143  #define BB_SORT
144  //#define BB_STTY
145 -#define BB_SWAPONOFF
146 -#define BB_SYNC
147 -#define BB_SYSLOGD
148 +//#define BB_SWAPONOFF
149 +//#define BB_SYNC
150 +//#define BB_SYSLOGD
151  #define BB_TAIL
152 -#define BB_TAR
153 -//#define BB_TEE
154 -//#define BB_TEST
155 +//#define BB_TAR
156 +#define BB_TEE
157 +#define BB_TEST
158  //#define BB_TELNET
159  //#define BB_TFTP
160  //#define BB_TIME
161 @@ -124,15 +124,15 @@
162  //#define BB_TR
163  //#define BB_TRACEROUTE
164  #define BB_TRUE_FALSE
165 -#define BB_TTY
166 +//#define BB_TTY
167  //#define BB_UNIX2DOS
168  //#define BB_UUENCODE
169  //#define BB_UUDECODE
170 -#define BB_UMOUNT
171 +//#define BB_UMOUNT
172  #define BB_UNIQ
173 -#define BB_UNAME
174 +//#define BB_UNAME
175  //#define BB_UPDATE
176 -#define BB_UPTIME
177 +//#define BB_UPTIME
178  //#define BB_USLEEP
179  //#define BB_VI
180  //#define BB_WATCHDOG
181 @@ -140,7 +140,7 @@
182  //#define BB_WGET
183  #define BB_WHICH
184  #define BB_WHOAMI
185 -#define BB_XARGS
186 +//#define BB_XARGS
187  #define BB_YES
188  // End of Applications List
189  //
190 @@ -182,13 +182,13 @@
191  //#define BB_FEATURE_USE_DEVPS_PATCH
192  //
193  // show verbose usage messages
194 -#define BB_FEATURE_VERBOSE_USAGE
195 +//#define BB_FEATURE_VERBOSE_USAGE
196  //
197  // Use termios to manipulate the screen ('more' is prettier with this on)
198  //#define BB_FEATURE_USE_TERMIOS
199  //
200  // calculate terminal & column widths (for more, ls, and telnet)
201 -#define BB_FEATURE_AUTOWIDTH
202 +//#define BB_FEATURE_AUTOWIDTH
203  //
204  // show username/groupnames for ls
205  #define BB_FEATURE_LS_USERNAME
206 @@ -271,11 +271,11 @@
207  //
208  // Enable command line editing in the shell.  
209  // Only relevant if a shell is enabled. On by default.
210 -#define BB_FEATURE_COMMAND_EDITING
211 +//#define BB_FEATURE_COMMAND_EDITING
212  //
213  // Enable tab completion in the shell.  This is now working quite nicely.
214  // This feature adds a bit over 4k. Only relevant if a shell is enabled.
215 -#define BB_FEATURE_COMMAND_TAB_COMPLETION
216 +//#define BB_FEATURE_COMMAND_TAB_COMPLETION
217  //
218  // Attempts to match usernames in a ~-prefixed path
219  //#define BB_FEATURE_COMMAND_USERNAME_COMPLETION
220 @@ -284,7 +284,7 @@
221  //were shell builtins.  Nice for staticly linking an emergency rescue shell,
222  //among other things. Off by default.
223  // Only relevant if a shell is enabled.
224 -//#define BB_FEATURE_SH_STANDALONE_SHELL
225 +#define BB_FEATURE_SH_STANDALONE_SHELL
226  //
227  //When this is enabled, busybox shell applets can be called using full path
228  //names.  This causes applets (i.e., most busybox commands) to override
229 @@ -306,7 +306,7 @@
230  // are doing is running scripts).  Disabing this is bad for interactive
231  // use, since when you hit ^C in an application, it will also kill the 
232  // shell.  This adds about 2.5k on an x86 system.
233 -#define BB_FEATURE_ASH_JOB_CONTROL
234 +//#define BB_FEATURE_ASH_JOB_CONTROL
235  //
236  //Turn on extra fbset options
237  //#define BB_FEATURE_FBSET_FANCY
238 @@ -371,7 +371,7 @@
239  #define BB_FEATURE_FIND_TYPE
240  //
241  // Support for the find -perm option.
242 -#define BB_FEATURE_FIND_PERM
243 +//#define BB_FEATURE_FIND_PERM
244  //
245  // Support for the find -mtime option.
246  #define BB_FEATURE_FIND_MTIME
247 @@ -420,7 +420,10 @@
248  // Nothing beyond this point should ever be touched by 
249  // mere mortals so leave this stuff alone.
250  //
251 +#ifdef _GNU_SOURCE
252  #include <features.h>
253 +#endif
254 +
255  #if defined(__uClinux__)
256         #undef BB_ASH                   /* Not even a chance it will work */
257         #undef BB_RPM2CPIO              /* Uses gz_open(), which uses fork() */
258 diff -ur ../busybox-0.60.5/Makefile ./Makefile
259 --- ../busybox-0.60.5/Makefile  Sun Oct 27 00:47:54 2002
260 +++ ./Makefile  Tue Nov 25 11:27:30 2003
261 @@ -49,7 +49,7 @@
262  # just 1.4k to the binary size (which is a _lot_ less then glibc NSS costs).
263  # Note that if you want hostname resolution to work with glibc, you still need
264  # the libnss_* libraries.  
265 -USE_SYSTEM_PWD_GRP = true
266 +USE_SYSTEM_PWD_GRP = false
267  
268  # This enables compiling with dmalloc ( http://dmalloc.com/ )
269  # which is an excellent public domain mem leak and malloc problem
270 @@ -83,7 +83,7 @@
271  
272  # If you are running a cross compiler, you may want to set this
273  # to something more interesting, like "powerpc-linux-".
274 -CROSS =
275 +CROSS = mips-unknown-elf-
276  CC = $(CROSS)gcc
277  AR = $(CROSS)ar
278  STRIP = $(CROSS)strip
279 @@ -106,11 +106,11 @@
280  #
281  # For other libraries, you are on your own...
282  #LDFLAGS+=-nostdlib
283 -#LIBRARIES = $(LIBCDIR)/lib/libc.a -lgcc
284 +LIBRARIES = -lglob -lregex
285  #CROSS_CFLAGS+=-nostdinc -I$(LIBCDIR)/include -I$(GCCINCDIR)
286  #GCCINCDIR = $(shell gcc -print-search-dirs | sed -ne "s/install: \(.*\)/\1include/gp")
287  
288 -WARNINGS = -Wall -Wshadow
289 +WARNINGS = -Wall -Wshadow -Werror -Wno-unused
290  
291  ARFLAGS = -r
292  
293 @@ -181,9 +181,9 @@
294      LDFLAGS += -Wl,-warn-common
295      STRIPCMD    = /bin/true -Since_we_are_debugging
296  else
297 -    CFLAGS  += $(WARNINGS) $(OPTIMIZATIONS) -D_GNU_SOURCE
298 -    LDFLAGS += -s -Wl,-warn-common
299 -    STRIPCMD    = $(STRIP) -s --remove-section=.note --remove-section=.comment
300 +    CFLAGS  += $(WARNINGS) $(OPTIMIZATIONS) -DNEWLIB_ASH
301 +    LDFLAGS += -Wl,-warn-common
302 +    STRIPCMD    = true
303  endif
304  ifeq ($(strip $(DOSTATIC)),true)
305      LDFLAGS += --static
306 @@ -260,7 +260,7 @@
307      PWD_LIB     = libpwd.a
308      PWD_CSRC=__getpwent.c pwent.c getpwnam.c getpwuid.c putpwent.c getpw.c \
309             fgetpwent.c __getgrent.c grent.c getgrnam.c getgrgid.c fgetgrent.c \
310 -           initgroups.c setgroups.c
311 +           initgroups.c
312      PWD_OBJS=$(patsubst %.c,$(PWD_GRP)/%.o, $(PWD_CSRC))
313  ifneq ($(strip $(BB_SRC_DIR)),)
314      PWD_CFLAGS = -I- -I.
315 @@ -273,19 +273,19 @@
316  LIBBB    = libbb
317  LIBBB_LIB = libbb.a
318  LIBBB_CSRC= ask_confirmation.c chomp.c concat_path_file.c copy_file.c \
319 -copy_file_chunk.c libc5.c device_open.c error_msg.c inode_hash.c \
320 -error_msg_and_die.c fgets_str.c find_mount_point.c find_pid_by_name.c \
321 -find_root_device.c full_read.c full_write.c get_console.c \
322 +copy_file_chunk.c device_open.c error_msg.c inode_hash.c \
323 +error_msg_and_die.c fgets_str.c find_pid_by_name.c \
324 +find_root_device.c full_read.c full_write.c \
325  get_last_path_component.c get_line_from_file.c gz_open.c human_readable.c \
326 -isdirectory.c kernel_version.c loop.c mode_string.c module_syscalls.c mtab.c \
327 +isdirectory.c mode_string.c \
328  mtab_file.c my_getgrnam.c my_getgrgid.c my_getpwnam.c my_getpwnamegid.c \
329  my_getpwuid.c parse_mode.c parse_number.c perror_msg.c perror_msg_and_die.c \
330  print_file.c process_escape_sequence.c read_package_field.c recursive_action.c \
331 -safe_read.c safe_strncpy.c syscalls.c syslog_msg_with_name.c time_string.c \
332 +safe_read.c safe_strncpy.c time_string.c \
333  trim.c unzip.c vdprintf.c verror_msg.c vperror_msg.c wfopen.c xfuncs.c \
334 -xgetcwd.c xreadlink.c xregcomp.c interface.c remove_file.c last_char_is.c \
335 -copyfd.c vherror_msg.c herror_msg.c herror_msg_and_die.c xgethostbyname.c \
336 -dirname.c make_directory.c create_icmp_socket.c u_signal_names.c arith.c \
337 +xgetcwd.c xreadlink.c xregcomp.c remove_file.c last_char_is.c \
338 +copyfd.c herror_msg.c herror_msg_and_die.c \
339 +dirname.c make_directory.c u_signal_names.c arith.c \
340  simplify_path.c
341  LIBBB_OBJS=$(patsubst %.c,$(LIBBB)/%.o, $(LIBBB_CSRC))
342  ifeq ($(strip $(BB_SRC_DIR)),)
343 diff -ur ../busybox-0.60.5/ash.c ./ash.c
344 --- ../busybox-0.60.5/ash.c     Tue Oct 22 18:14:29 2002
345 +++ ./ash.c     Tue Nov 25 11:17:08 2003
346 @@ -84,11 +84,15 @@
347  #include <stdio.h>
348  #include <stdlib.h>
349  #include <string.h>
350 +#ifndef NEWLIB_ASH
351  #include <sysexits.h>
352 +#endif
353  #include <unistd.h>
354  #include <sys/stat.h>
355  #include <sys/cdefs.h>
356 +#ifndef NEWLIB_ASH
357  #include <sys/ioctl.h>
358 +#endif
359  #include <sys/param.h>
360  #include <sys/resource.h>
361  #include <sys/time.h>
362 @@ -268,6 +272,7 @@
363   * more fun than worrying about efficiency and portability. :-))
364   */
365  
366 +#ifndef NEWLIB_ASH
367  static void onint(void);
368  static volatile int suppressint;
369  static volatile int intpending;
370 @@ -287,6 +292,16 @@
371  #define CLEAR_PENDING_INT intpending = 0
372  #define int_pending() intpending
373  
374 +#else
375 +
376 +#define INTON
377 +#define INTOFF
378 +#define FORCEINTON
379 +#define CLEAR_PENDING_INT
380 +#define int_pending() 0
381 +
382 +#endif
383 +
384  
385  typedef void *pointer;
386  
387 @@ -1556,7 +1571,9 @@
388  #endif
389  static int unsetcmd(int, char **);
390  static int waitcmd(int, char **);
391 +#ifndef NEWLIB_ASH
392  static int ulimitcmd(int, char **);
393 +#endif
394  static int timescmd(int, char **);
395  
396  #ifdef CONFIG_ASH_MATH_SUPPORT
397 @@ -1647,10 +1664,14 @@
398         {BUILTIN_NOSPEC "setvar", setvarcmd},
399         {BUILTIN_SPECIAL "shift", shiftcmd},
400         {BUILTIN_SPECIAL "times", timescmd},
401 +#ifndef NEWLIB_ASH
402         {BUILTIN_SPECIAL "trap", trapcmd},
403 +#endif
404         {BUILTIN_REGULAR "true", true_main},
405         {BUILTIN_NOSPEC "type", typecmd},
406 +#ifndef NEWLIB_ASH
407         {BUILTIN_NOSPEC "ulimit", ulimitcmd},
408 +#endif
409         {BUILTIN_REGULAR "umask", umaskcmd},
410  #ifdef CONFIG_ASH_ALIAS
411         {BUILTIN_REGULAR "unalias", unaliascmd},
412 @@ -1918,6 +1939,8 @@
413   * just defensive programming.)
414   */
415  
416 +#ifndef NEWLIB_ASH
417 +
418  static void onint(void)
419  {
420         sigset_t mysigset;
421 @@ -1937,6 +1960,7 @@
422         /* NOTREACHED */
423  }
424  
425 +#endif
426  
427  static char *commandname;      /* currently executing command */
428  
429 @@ -2086,7 +2110,7 @@
430  }
431  
432  
433 -#ifdef CONFIG_ASH_OPTIMIZE_FOR_SIZE
434 +#if defined(CONFIG_ASH_OPTIMIZE_FOR_SIZE) && !defined(NEWLIB_ASH)
435  static void __inton()
436  {
437         if (--suppressint == 0 && intpending) {
438 @@ -5597,7 +5621,6 @@
439  
440  static void init(void)
441  {
442 -
443         /* from cd.c: */
444         {
445                 curdir = nullstr;
446 @@ -5621,8 +5644,10 @@
447                         }
448                 }
449  
450 +#ifndef NEWLIB_ASH
451                 snprintf(ppid, sizeof(ppid), "%d", (int) getppid());
452                 setvar("PPID", ppid, 0);
453 +#endif
454         }
455  }
456  
457 @@ -6214,12 +6239,16 @@
458                                 else    /* WIFSIGNALED(ps->status) */
459  #endif
460                                         i = WTERMSIG(ps->status);
461 +#ifndef NEWLIB_ASH
462                                 if ((i & 0x7F) < NSIG && sys_siglist[i & 0x7F])
463                                         strcpy(s, sys_siglist[i & 0x7F]);
464                                 else
465 +#endif
466                                         snprintf(s, 64, "Signal %d", i & 0x7F);
467 +#ifndef NEWLIB_ASH
468                                 if (WCOREDUMP(ps->status))
469                                         strcat(s, " (core dumped)");
470 +#endif
471                         }
472                         out1str(s);
473                         col += strlen(s);
474 @@ -6641,7 +6670,11 @@
475  #endif
476         if (block == 0)
477                 flags |= WNOHANG;
478 +#ifndef NEWLIB_ASH
479         return wait3(status, flags, (struct rusage *) NULL);
480 +#else
481 +    return waitpid(-1,status,flags);
482 +#endif
483  }
484  
485  static int dowait(int block, struct job *job)
486 @@ -6700,7 +6733,9 @@
487         }
488         INTON;
489         if (!rootshell || !iflag || (job && thisjob == job)) {
490 +#ifndef NEWLIB_ASH
491                 core = WCOREDUMP(status);
492 +#endif
493  #ifdef BB_FEATURE_ASH_JOB_CONTROL
494                 if (WIFSTOPPED(status))
495                         sig = WSTOPSIG(status);
496 @@ -6718,12 +6753,16 @@
497                         if (sig == SIGTSTP && rootshell && iflag)
498                                 out2fmt("%%%ld ", (long) (job - jobtab + 1));
499  #endif
500 +#ifndef NEWLIB_ASH
501                         if (sig < NSIG && sys_siglist[sig])
502                                 out2str(sys_siglist[sig]);
503                         else
504 +#endif
505                                 out2fmt("Signal %d", sig);
506 +#ifndef NEWLIB_ASH
507                         if (core)
508                                 out2str(" - core dumped");
509 +#endif
510                         out2c('\n');
511                 } else {
512                         TRACE(("Not printing status: status=%d, sig=%d\n", status, sig));
513 @@ -7993,6 +8032,8 @@
514         {NULL, 0, 0}
515  };
516  
517 +#ifndef NEWLIB_ASH
518 +
519  static int ulimitcmd(int argc, char **argv)
520  {
521         static const char unlimited_string[] = "unlimited";
522 @@ -8118,6 +8159,8 @@
523         return 0;
524  }
525  
526 +#endif /* !NEWLIB_ASH */
527 +
528  /*
529   * prefix -- see if pfx is a prefix of string.
530   */
531 @@ -11426,6 +11469,8 @@
532   * The trap builtin.
533   */
534  
535 +#ifndef NEWLIB_ASH
536 +
537  static int trapcmd(int argc, char **argv)
538  {
539         char *action;
540 @@ -11475,6 +11520,7 @@
541         return 0;
542  }
543  
544 +#endif /*!NEWLIB_ASH */
545  
546  /*
547   * Set the signal handler for the specified signal.  The routine figures
548 @@ -11485,7 +11531,9 @@
549  {
550         int action;
551         char *t;
552 +#ifndef NEWLIB_ASH
553         struct sigaction act;
554 +#endif
555  
556         if ((t = trap[signo]) == NULL)
557                 action = S_DFL;
558 @@ -11527,6 +11575,7 @@
559                 /*
560                  * current setting unknown
561                  */
562 +#ifndef NEWLIB_ASH
563                 if (sigaction(signo, 0, &act) == -1) {
564                         /*
565                          * Pretend it worked; maybe we should give a warning
566 @@ -11536,6 +11585,7 @@
567                         return;
568                 }
569                 if (act.sa_handler == SIG_IGN) {
570 +
571                         if (mflag && (signo == SIGTSTP ||
572                                                   signo == SIGTTIN || signo == SIGTTOU)) {
573                                 *t = S_IGN;     /* don't hard ignore these */
574 @@ -11544,15 +11594,22 @@
575                 } else {
576                         *t = S_RESET;   /* force to be set */
577                 }
578 +#else
579 +        *t = S_DFL;
580 +#endif
581         }
582         if (*t == S_HARD_IGN || *t == action)
583                 return;
584 +       *t = action;
585 +#ifndef NEWLIB_ASH
586         act.sa_handler = ((action == S_CATCH) ? onsig
587                                           : ((action == S_IGN) ? SIG_IGN : SIG_DFL));
588 -       *t = action;
589         act.sa_flags = 0;
590         sigemptyset(&act.sa_mask);
591         sigaction(signo, &act, 0);
592 +#else
593 +    signal(signo,((action == S_CATCH) ? onsig : ((action == S_IGN) ? SIG_IGN : SIG_DFL)));
594 +#endif
595  }
596  
597  /*
598 @@ -11574,10 +11631,12 @@
599  
600  static void onsig(int signo)
601  {
602 +#ifndef NEWLIB_ASH
603         if (signo == SIGINT && trap[SIGINT] == NULL) {
604                 onint();
605                 return;
606         }
607 +#endif
608         gotsig[signo - 1] = 1;
609         pendingsigs++;
610  }
611 @@ -12153,6 +12212,7 @@
612  
613  static struct var **findvar(struct var **vpp, const char *name)
614  {
615 +    int n=0;
616         for (; *vpp; vpp = &(*vpp)->next) {
617                 if (varequal((*vpp)->text, name)) {
618                         break;
619 @@ -12168,8 +12228,11 @@
620  static int timescmd(int argc, char **argv)
621  {
622         struct tms buf;
623 +#ifdef NEWLIB_ASH
624 +    long int clk_tck = _CLOCKS_PER_SEC_;
625 +#else
626         long int clk_tck = sysconf(_SC_CLK_TCK);
627 -
628 +#endif
629         times(&buf);
630         printf("%dm%fs %dm%fs\n%dm%fs %dm%fs\n",
631                    (int) (buf.tms_utime / clk_tck / 60),
632 diff -ur ../busybox-0.60.5/busybox.h ./busybox.h
633 --- ../busybox-0.60.5/busybox.h Fri Mar 15 21:11:46 2002
634 +++ ./busybox.h Tue Nov 25 11:10:52 2003
635 @@ -37,8 +37,9 @@
636  #include "dmalloc.h"
637  #endif
638  
639 +#ifdef _GNU_SOURCE
640  #include <features.h>
641 -
642 +#endif
643  
644  enum Location {
645         _BB_DIR_ROOT = 0,
646 @@ -85,7 +86,9 @@
647  
648  /* Bit map related macros -- libc5 doens't provide these... sigh.  */
649  #ifndef setbit
650 +#ifndef NBBY
651  #define NBBY            CHAR_BIT
652 +#endif
653  #define setbit(a,i)     ((a)[(i)/NBBY] |= 1<<((i)%NBBY))
654  #define clrbit(a,i)     ((a)[(i)/NBBY] &= ~(1<<((i)%NBBY)))
655  #define isset(a,i)      ((a)[(i)/NBBY] & (1<<((i)%NBBY)))
656 Only in ../busybox-0.60.5: busybox.links
657 diff -ur ../busybox-0.60.5/busybox.sh ./busybox.sh
658 --- ../busybox-0.60.5/busybox.sh        Wed Sep 26 02:20:54 2001
659 +++ ./busybox.sh        Tue Nov 25 10:57:58 2003
660 @@ -5,7 +5,7 @@
661  
662  RAW=` \
663      $CC -E -dM ${1:-Config.h} | \
664 -    sed -n -e '/^.*BB_FEATURE.*$/d;s/^#define.*\<BB_\(.*\)\>/\1.c/gp;' \
665 +     sed -n -e '/^.*BB_FEATURE.*$/d;s/^#define.*BB_\([A-Z0-9_]*\)/\1.c/gp;' \
666      | tr A-Z a-z | sort
667  `
668  test "${RAW}" != "" ||  exit
669 diff -ur ../busybox-0.60.5/date.c ./date.c
670 --- ../busybox-0.60.5/date.c    Sat Jun 15 10:35:13 2002
671 +++ ./date.c    Tue Nov 25 11:26:25 2003
672 @@ -210,9 +210,7 @@
673  
674                 /* if setting time, set it */
675                 if (set_time) {
676 -                       if (stime(&tm) < 0) {
677 -                               perror_msg("cannot set date");
678 -                       }
679 +            perror_msg("cannot set date");
680                 }
681         }
682  
683 Only in ../busybox-0.60.5/docs: BusyBox.1
684 Only in ../busybox-0.60.5/docs: BusyBox.html
685 Only in ../busybox-0.60.5/docs: BusyBox.txt
686 Only in ../busybox-0.60.5/docs: busybox.pod
687 diff -ur ../busybox-0.60.5/libbb/libbb.h ./libbb/libbb.h
688 --- ../busybox-0.60.5/libbb/libbb.h     Wed Sep 18 15:21:07 2002
689 +++ ./libbb/libbb.h     Tue Nov 25 11:10:27 2003
690 @@ -25,8 +25,6 @@
691  #include <sys/stat.h>
692  #include <sys/types.h>
693  
694 -#include <netdb.h>
695 -
696  #ifndef _BB_INTERNAL_H_
697  #include "../busybox.h"
698  #endif
699 @@ -35,7 +33,9 @@
700  #include "dmalloc.h"
701  #endif
702  
703 +#ifdef _GNU_SOURCE
704  #include <features.h>
705 +#endif
706  
707  #if (__GNU_LIBRARY__ < 5) && (!defined __dietlibc__)
708  /* libc5 doesn't define socklen_t */
709 diff -ur ../busybox-0.60.5/ls.c ./ls.c
710 --- ../busybox-0.60.5/ls.c      Mon Sep 16 01:53:01 2002
711 +++ ./ls.c      Tue Nov 25 11:29:41 2003
712 @@ -43,7 +43,7 @@
713  
714  enum {
715         TERMINAL_WIDTH = 80,            /* use 79 if terminal has linefold bug */
716 -       COLUMN_WIDTH = 14,                      /* default if AUTOWIDTH not defined */
717 +       COLUMN_WIDTH = 18,                      /* default if AUTOWIDTH not defined */
718         COLUMN_GAP = 2,                         /* includes the file type char */
719  };
720  
721 @@ -61,8 +61,10 @@
722  #include <stdlib.h>
723  #include <fcntl.h>
724  #include <signal.h>
725 +#ifdef BB_FEATURE_AUTOWIDTH
726  #include <termios.h>
727  #include <sys/ioctl.h>
728 +#endif
729  #include "busybox.h"
730  
731  #ifdef BB_FEATURE_LS_TIMESTAMPS
732 @@ -484,7 +486,7 @@
733                 column_width = COLUMN_WIDTH;
734         }
735  #else
736 -       ncols= TERMINAL_WIDTH;
737 +    ncols= (int) (TERMINAL_WIDTH / (COLUMN_WIDTH+COLUMN_GAP));
738  #endif
739         switch (style_fmt) {
740                 case STYLE_LONG:        /* one record per line, extended info */
741 diff -ur ../busybox-0.60.5/md5sum.c ./md5sum.c
742 --- ../busybox-0.60.5/md5sum.c  Tue Oct 22 18:13:57 2002
743 +++ ./md5sum.c  Tue Nov 25 11:22:37 2003
744 @@ -44,13 +44,17 @@
745  #include <getopt.h>
746  #include <stdlib.h>
747  #include <string.h>
748 -#include <endian.h>
749  #include <sys/types.h>
750  #if defined HAVE_LIMITS_H
751  # include <limits.h>
752  #endif
753  #include "busybox.h"
754  
755 +typedef unsigned int u_int32_t;
756 +#ifndef __P
757 +#define __P(x) x
758 +#endif
759 +
760  /* For some silly reason, this file uses backwards TRUE and FALSE conventions */
761  #undef TRUE
762  #undef FALSE
763 @@ -146,11 +150,7 @@
764  //----------------------------------------------------------------------------
765  
766  /* Handle endian-ness */
767 -#if __BYTE_ORDER == __LITTLE_ENDIAN
768 -       #define SWAP(n) (n)
769 -#else
770 -       #define SWAP(n) ((n << 24) | ((n&65280)<<8) | ((n&16711680)>>8) | (n>>24))
771 -#endif
772 +#define SWAP(n) ((n << 24) | ((n&65280)<<8) | ((n&16711680)>>8) | (n>>24))
773  
774  
775  
776 diff -ur ../busybox-0.60.5/printf.c ./printf.c
777 --- ../busybox-0.60.5/printf.c  Mon Mar 19 14:25:49 2001
778 +++ ./printf.c  Tue Nov 25 11:22:49 2003
779 @@ -57,6 +57,10 @@
780  #include <ctype.h>
781  #include "busybox.h"
782  
783 +#ifndef __P
784 +#define __P(x) x
785 +#endif
786 +
787  
788  #ifndef S_IFMT
789  static const int S_IFMT = 0170000;
790 diff -ur ../busybox-0.60.5/pwd_grp/grp.h ./pwd_grp/grp.h
791 --- ../busybox-0.60.5/pwd_grp/grp.h     Sat Jan 27 03:24:39 2001
792 +++ ./pwd_grp/grp.h     Tue Nov 25 11:05:36 2003
793 @@ -5,8 +5,14 @@
794  #include <grp.h>
795  #else
796  
797 +#ifndef __P
798 +#define __P(x) x
799 +#endif
800 +
801  #include <sys/types.h>
802 +#ifdef _GNU_SOURCE
803  #include <features.h>
804 +#endif
805  #include <stdio.h>
806  
807  /* The group structure */
808 diff -ur ../busybox-0.60.5/pwd_grp/pwd.h ./pwd_grp/pwd.h
809 --- ../busybox-0.60.5/pwd_grp/pwd.h     Sat Jan 27 03:24:39 2001
810 +++ ./pwd_grp/pwd.h     Tue Nov 25 11:05:09 2003
811 @@ -5,8 +5,14 @@
812  #include <pwd.h>
813  #else
814  
815 +#ifndef __P
816 +#define __P(x) x
817 +#endif
818 +
819  #include <sys/types.h>
820 +#ifdef _GNU_SOURCE
821  #include <features.h>
822 +#endif
823  #include <stdio.h>
824  
825  /* The passwd structure.  */