aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--archival/ar.c1
-rw-r--r--archival/bunzip2.c3
-rw-r--r--archival/cpio.c17
-rw-r--r--archival/dpkg_deb.c1
-rw-r--r--archival/gunzip.c1
-rw-r--r--archival/libunarchive/unpack_ar_archive.c1
-rw-r--r--archival/uncompress.c1
-rw-r--r--archival/unzip.c1
-rw-r--r--console-tools/setconsole.c2
-rw-r--r--coreutils/cut.c1
-rw-r--r--coreutils/date.c1
-rw-r--r--coreutils/dos2unix.c1
-rw-r--r--coreutils/env.c2
-rw-r--r--coreutils/install.c2
-rw-r--r--coreutils/ls.c2
-rw-r--r--coreutils/mkdir.c2
-rw-r--r--coreutils/mv.c2
-rw-r--r--coreutils/stat.c2
-rw-r--r--coreutils/sum.c1
-rw-r--r--coreutils/uudecode.c2
-rw-r--r--coreutils/uuencode.c1
-rw-r--r--debianutils/readlink.c7
-rw-r--r--debianutils/start_stop_daemon.c2
23 files changed, 20 insertions, 36 deletions
diff --git a/archival/ar.c b/archival/ar.c
index 21096d712..411a25e0a 100644
--- a/archival/ar.c
+++ b/archival/ar.c
@@ -27,7 +27,6 @@
27 */ 27 */
28 28
29#include <fcntl.h> 29#include <fcntl.h>
30#include <getopt.h>
31#include <stdio.h> 30#include <stdio.h>
32#include <stdlib.h> 31#include <stdlib.h>
33#include <string.h> 32#include <string.h>
diff --git a/archival/bunzip2.c b/archival/bunzip2.c
index 740e26919..2ce6cfb86 100644
--- a/archival/bunzip2.c
+++ b/archival/bunzip2.c
@@ -6,7 +6,6 @@
6 */ 6 */
7 7
8#include <fcntl.h> 8#include <fcntl.h>
9#include <getopt.h>
10#include <stdio.h> 9#include <stdio.h>
11#include <stdlib.h> 10#include <stdlib.h>
12#include <string.h> 11#include <string.h>
@@ -35,7 +34,7 @@ int bunzip2_main(int argc, char **argv)
35 src_fd = STDIN_FILENO; 34 src_fd = STDIN_FILENO;
36 filename = 0; 35 filename = 0;
37 } 36 }
38 37
39 /* if called as bzcat force the stdout flag */ 38 /* if called as bzcat force the stdout flag */
40 if ((opt & BUNZIP2_OPT_STDOUT) || bb_applet_name[2] == 'c') 39 if ((opt & BUNZIP2_OPT_STDOUT) || bb_applet_name[2] == 'c')
41 filename = 0; 40 filename = 0;
diff --git a/archival/cpio.c b/archival/cpio.c
index 0fbe7b8e5..820f03e9b 100644
--- a/archival/cpio.c
+++ b/archival/cpio.c
@@ -24,20 +24,19 @@
24 * 24 *
25 */ 25 */
26#include <fcntl.h> 26#include <fcntl.h>
27#include <getopt.h>
28#include <stdlib.h> 27#include <stdlib.h>
29#include <string.h> 28#include <string.h>
30#include <unistd.h> 29#include <unistd.h>
31#include "unarchive.h" 30#include "unarchive.h"
32#include "busybox.h" 31#include "busybox.h"
33 32
34#define CPIO_OPT_EXTRACT 0x01 33#define CPIO_OPT_EXTRACT 0x01
35#define CPIO_OPT_TEST 0x02 34#define CPIO_OPT_TEST 0x02
36#define CPIO_OPT_UNCONDITIONAL 0x04 35#define CPIO_OPT_UNCONDITIONAL 0x04
37#define CPIO_OPT_VERBOSE 0x08 36#define CPIO_OPT_VERBOSE 0x08
38#define CPIO_OPT_FILE 0x10 37#define CPIO_OPT_FILE 0x10
39#define CPIO_OPT_CREATE_LEADING_DIR 0x20 38#define CPIO_OPT_CREATE_LEADING_DIR 0x20
40#define CPIO_OPT_PRESERVE_MTIME 0x40 39#define CPIO_OPT_PRESERVE_MTIME 0x40
41 40
42extern int cpio_main(int argc, char **argv) 41extern int cpio_main(int argc, char **argv)
43{ 42{
@@ -59,7 +58,7 @@ extern int cpio_main(int argc, char **argv)
59 } 58 }
60 59
61 if (opt & CPIO_OPT_TEST) { 60 if (opt & CPIO_OPT_TEST) {
62 /* if both extract and test option are given, ignore extract option */ 61 /* if both extract and test options are given, ignore extract option */
63 if (opt & CPIO_OPT_EXTRACT) { 62 if (opt & CPIO_OPT_EXTRACT) {
64 opt &= ~CPIO_OPT_EXTRACT; 63 opt &= ~CPIO_OPT_EXTRACT;
65 } 64 }
@@ -79,7 +78,7 @@ extern int cpio_main(int argc, char **argv)
79 archive_handle->action_header = header_list; 78 archive_handle->action_header = header_list;
80 } 79 }
81 } 80 }
82 if (cpio_filename) { /* CPIO_OPT_FILE */ 81 if (cpio_filename) { /* CPIO_OPT_FILE */
83 archive_handle->src_fd = bb_xopen(cpio_filename, O_RDONLY); 82 archive_handle->src_fd = bb_xopen(cpio_filename, O_RDONLY);
84 archive_handle->seek = seek_by_jump; 83 archive_handle->seek = seek_by_jump;
85 } 84 }
diff --git a/archival/dpkg_deb.c b/archival/dpkg_deb.c
index 6c665e57a..1e8bd8ad2 100644
--- a/archival/dpkg_deb.c
+++ b/archival/dpkg_deb.c
@@ -18,7 +18,6 @@
18#include <stdlib.h> 18#include <stdlib.h>
19#include <string.h> 19#include <string.h>
20#include <unistd.h> 20#include <unistd.h>
21#include <getopt.h>
22 21
23#include "unarchive.h" 22#include "unarchive.h"
24#include "busybox.h" 23#include "busybox.h"
diff --git a/archival/gunzip.c b/archival/gunzip.c
index beb7bd12e..a4db7ca31 100644
--- a/archival/gunzip.c
+++ b/archival/gunzip.c
@@ -63,7 +63,6 @@ static char *license_msg[] = {
63#include <stdlib.h> 63#include <stdlib.h>
64#include <string.h> 64#include <string.h>
65#include <unistd.h> 65#include <unistd.h>
66#include <getopt.h>
67#include <sys/types.h> 66#include <sys/types.h>
68#include <sys/stat.h> 67#include <sys/stat.h>
69#include <fcntl.h> 68#include <fcntl.h>
diff --git a/archival/libunarchive/unpack_ar_archive.c b/archival/libunarchive/unpack_ar_archive.c
index e8f113bcf..fa48c6fca 100644
--- a/archival/libunarchive/unpack_ar_archive.c
+++ b/archival/libunarchive/unpack_ar_archive.c
@@ -16,7 +16,6 @@
16#include <fcntl.h> 16#include <fcntl.h>
17#include <stdlib.h> 17#include <stdlib.h>
18#include <string.h> 18#include <string.h>
19#include <getopt.h>
20#include "unarchive.h" 19#include "unarchive.h"
21#include "busybox.h" 20#include "busybox.h"
22 21
diff --git a/archival/uncompress.c b/archival/uncompress.c
index 48b4e2cad..3bd87093e 100644
--- a/archival/uncompress.c
+++ b/archival/uncompress.c
@@ -20,7 +20,6 @@
20#include <stdlib.h> 20#include <stdlib.h>
21#include <string.h> 21#include <string.h>
22#include <unistd.h> 22#include <unistd.h>
23#include <getopt.h>
24#include <sys/types.h> 23#include <sys/types.h>
25#include <sys/stat.h> 24#include <sys/stat.h>
26#include <fcntl.h> 25#include <fcntl.h>
diff --git a/archival/unzip.c b/archival/unzip.c
index d60cb4db4..50d148692 100644
--- a/archival/unzip.c
+++ b/archival/unzip.c
@@ -38,7 +38,6 @@
38 */ 38 */
39 39
40#include <fcntl.h> 40#include <fcntl.h>
41#include <getopt.h>
42#include <stdlib.h> 41#include <stdlib.h>
43#include <string.h> 42#include <string.h>
44#include <unistd.h> 43#include <unistd.h>
diff --git a/console-tools/setconsole.c b/console-tools/setconsole.c
index 5806f21ed..6b4989d77 100644
--- a/console-tools/setconsole.c
+++ b/console-tools/setconsole.c
@@ -24,7 +24,7 @@
24#include <sys/types.h> 24#include <sys/types.h>
25#include <fcntl.h> 25#include <fcntl.h>
26#include <stdio.h> 26#include <stdio.h>
27#include <getopt.h> 27#include <getopt.h> /* struct option */
28 28
29#include "busybox.h" 29#include "busybox.h"
30 30
diff --git a/coreutils/cut.c b/coreutils/cut.c
index f65754e63..f9c72ca81 100644
--- a/coreutils/cut.c
+++ b/coreutils/cut.c
@@ -23,7 +23,6 @@
23 23
24#include <stdio.h> 24#include <stdio.h>
25#include <stdlib.h> 25#include <stdlib.h>
26#include <getopt.h>
27#include <unistd.h> 26#include <unistd.h>
28#include <string.h> 27#include <string.h>
29#include <limits.h> 28#include <limits.h>
diff --git a/coreutils/date.c b/coreutils/date.c
index 0488b2de3..9583a0036 100644
--- a/coreutils/date.c
+++ b/coreutils/date.c
@@ -29,7 +29,6 @@
29#include <time.h> 29#include <time.h>
30#include <stdio.h> 30#include <stdio.h>
31#include <string.h> 31#include <string.h>
32#include <getopt.h>
33#include "busybox.h" 32#include "busybox.h"
34 33
35 34
diff --git a/coreutils/dos2unix.c b/coreutils/dos2unix.c
index 3488f3354..0c419aca7 100644
--- a/coreutils/dos2unix.c
+++ b/coreutils/dos2unix.c
@@ -28,7 +28,6 @@
28 */ 28 */
29 29
30#include <string.h> 30#include <string.h>
31#include <getopt.h>
32#include <unistd.h> 31#include <unistd.h>
33#include <stdint.h> 32#include <stdint.h>
34#include <fcntl.h> 33#include <fcntl.h>
diff --git a/coreutils/env.c b/coreutils/env.c
index 70cef6588..1a8ad7c78 100644
--- a/coreutils/env.c
+++ b/coreutils/env.c
@@ -47,7 +47,7 @@
47#include <stdlib.h> 47#include <stdlib.h>
48#include <errno.h> 48#include <errno.h>
49#include <unistd.h> 49#include <unistd.h>
50#include <getopt.h> 50#include <getopt.h> /* struct option */
51#include "busybox.h" 51#include "busybox.h"
52 52
53 53
diff --git a/coreutils/install.c b/coreutils/install.c
index e22dda6f9..74e1d9acd 100644
--- a/coreutils/install.c
+++ b/coreutils/install.c
@@ -23,10 +23,10 @@
23#include <sys/stat.h> 23#include <sys/stat.h>
24#include <sys/types.h> 24#include <sys/types.h>
25#include <errno.h> 25#include <errno.h>
26#include <getopt.h>
27#include <stdlib.h> 26#include <stdlib.h>
28#include <string.h> 27#include <string.h>
29#include <unistd.h> 28#include <unistd.h>
29#include <getopt.h> /* struct option */
30 30
31#include "busybox.h" 31#include "busybox.h"
32#include "libcoreutils/coreutils.h" 32#include "libcoreutils/coreutils.h"
diff --git a/coreutils/ls.c b/coreutils/ls.c
index ac2557a55..4dfa9f507 100644
--- a/coreutils/ls.c
+++ b/coreutils/ls.c
@@ -60,7 +60,7 @@ enum {
60#include <fcntl.h> 60#include <fcntl.h>
61#include <signal.h> 61#include <signal.h>
62#include <termios.h> 62#include <termios.h>
63#include <getopt.h> 63#include <getopt.h> /* struct option */
64#include <sys/ioctl.h> 64#include <sys/ioctl.h>
65#include <sys/sysmacros.h> /* major() and minor() */ 65#include <sys/sysmacros.h> /* major() and minor() */
66#include "busybox.h" 66#include "busybox.h"
diff --git a/coreutils/mkdir.c b/coreutils/mkdir.c
index 50364f17f..e24ef4f89 100644
--- a/coreutils/mkdir.c
+++ b/coreutils/mkdir.c
@@ -31,7 +31,7 @@
31 31
32#include <stdlib.h> 32#include <stdlib.h>
33#include <unistd.h> 33#include <unistd.h>
34#include <getopt.h> 34#include <getopt.h> /* struct option */
35#include "busybox.h" 35#include "busybox.h"
36 36
37static const struct option mkdir_long_options[] = { 37static const struct option mkdir_long_options[] = {
diff --git a/coreutils/mv.c b/coreutils/mv.c
index 43a8e6d7d..aef1ed19a 100644
--- a/coreutils/mv.c
+++ b/coreutils/mv.c
@@ -31,7 +31,7 @@
31#include <dirent.h> 31#include <dirent.h>
32#include <errno.h> 32#include <errno.h>
33#include <stdlib.h> 33#include <stdlib.h>
34#include <getopt.h> 34#include <getopt.h> /* struct option */
35#include "busybox.h" 35#include "busybox.h"
36#include "libcoreutils/coreutils.h" 36#include "libcoreutils/coreutils.h"
37 37
diff --git a/coreutils/stat.c b/coreutils/stat.c
index 4afe249c0..138cc9e8b 100644
--- a/coreutils/stat.c
+++ b/coreutils/stat.c
@@ -30,7 +30,7 @@
30#include <grp.h> 30#include <grp.h>
31#include <sys/vfs.h> 31#include <sys/vfs.h>
32#include <time.h> 32#include <time.h>
33#include <getopt.h> 33#include <getopt.h> /* optind */
34#include <sys/stat.h> 34#include <sys/stat.h>
35#include <sys/statfs.h> 35#include <sys/statfs.h>
36#include <sys/statvfs.h> 36#include <sys/statvfs.h>
diff --git a/coreutils/sum.c b/coreutils/sum.c
index 3b4941d28..0a9c9734f 100644
--- a/coreutils/sum.c
+++ b/coreutils/sum.c
@@ -18,7 +18,6 @@
18#include <sys/stat.h> 18#include <sys/stat.h>
19#include <fcntl.h> 19#include <fcntl.h>
20#include <unistd.h> 20#include <unistd.h>
21#include <getopt.h>
22 21
23#include "busybox.h" 22#include "busybox.h"
24 23
diff --git a/coreutils/uudecode.c b/coreutils/uudecode.c
index 57d4e8371..6167c9fad 100644
--- a/coreutils/uudecode.c
+++ b/coreutils/uudecode.c
@@ -24,7 +24,7 @@
24 24
25#include <stdio.h> 25#include <stdio.h>
26#include <errno.h> 26#include <errno.h>
27#include <getopt.h> 27#include <getopt.h> /* optind */
28#include <string.h> 28#include <string.h>
29#include <stdlib.h> 29#include <stdlib.h>
30 30
diff --git a/coreutils/uuencode.c b/coreutils/uuencode.c
index 42f629f48..2660f4a19 100644
--- a/coreutils/uuencode.c
+++ b/coreutils/uuencode.c
@@ -19,7 +19,6 @@
19 * along with this program; if not, write to the Free Software 19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 20 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21 */ 21 */
22#include <getopt.h>
23#include <stdio.h> 22#include <stdio.h>
24#include <string.h> 23#include <string.h>
25#include <stdlib.h> 24#include <stdlib.h>
diff --git a/debianutils/readlink.c b/debianutils/readlink.c
index 90927bb74..dd5612052 100644
--- a/debianutils/readlink.c
+++ b/debianutils/readlink.c
@@ -43,8 +43,6 @@ int readlink_main(int argc, char **argv)
43 RESERVE_CONFIG_BUFFER(resolved_path, PATH_MAX); 43 RESERVE_CONFIG_BUFFER(resolved_path, PATH_MAX);
44#endif 44#endif
45 45
46 /* no options, no getopt */
47
48 if (optind + 1 != argc) 46 if (optind + 1 != argc)
49 bb_show_usage(); 47 bb_show_usage();
50 48
@@ -58,9 +56,8 @@ int readlink_main(int argc, char **argv)
58 if (!buf) 56 if (!buf)
59 return EXIT_FAILURE; 57 return EXIT_FAILURE;
60 puts(buf); 58 puts(buf);
61#ifdef CONFIG_FEATURE_CLEAN_UP 59
62 free(buf); 60 if (ENABLE_FEATURE_CLEAN_UP) free(buf);
63#endif
64 61
65 return EXIT_SUCCESS; 62 return EXIT_SUCCESS;
66} 63}
diff --git a/debianutils/start_stop_daemon.c b/debianutils/start_stop_daemon.c
index 4fce80dbb..b1ebe2fa7 100644
--- a/debianutils/start_stop_daemon.c
+++ b/debianutils/start_stop_daemon.c
@@ -16,7 +16,7 @@
16#include <sys/stat.h> 16#include <sys/stat.h>
17#include <dirent.h> 17#include <dirent.h>
18#include <unistd.h> 18#include <unistd.h>
19#include <getopt.h> 19#include <getopt.h> /* struct option */
20 20
21#include "busybox.h" 21#include "busybox.h"
22#include "pwd_.h" 22#include "pwd_.h"