diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2006-10-10 21:00:47 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2006-10-10 21:00:47 +0000 |
commit | cba9ef5523f09ecc3240f9f6efcdd0440c652c91 (patch) | |
tree | 79a2f859df1f6eef15defd02bd2f453735ed327e | |
parent | 1ac42bf66e2c181b886e89f9222cae65676c9e8a (diff) | |
download | busybox-w32-cba9ef5523f09ecc3240f9f6efcdd0440c652c91.tar.gz busybox-w32-cba9ef5523f09ecc3240f9f6efcdd0440c652c91.tar.bz2 busybox-w32-cba9ef5523f09ecc3240f9f6efcdd0440c652c91.zip |
fixes from Vladimir Dronnikov <dronnikov@gmail.ru>
-rw-r--r-- | Makefile | 10 | ||||
-rw-r--r-- | archival/libunarchive/data_extract_all.c | 96 | ||||
-rw-r--r-- | archival/libunarchive/get_header_cpio.c | 6 | ||||
-rw-r--r-- | archival/libunarchive/get_header_tar.c | 13 | ||||
-rw-r--r-- | archival/libunarchive/init_handle.c | 8 | ||||
-rw-r--r-- | e2fsprogs/e2p/Kbuild | 6 | ||||
-rw-r--r-- | include/libbb.h | 11 | ||||
-rw-r--r-- | libbb/xatol.c | 9 | ||||
-rw-r--r-- | modutils/Config.in | 2 | ||||
-rw-r--r-- | networking/wget.c | 2 | ||||
-rw-r--r-- | runit/chpst.c | 4 | ||||
-rw-r--r-- | shell/ash.c | 2 |
12 files changed, 103 insertions, 66 deletions
@@ -563,9 +563,17 @@ busybox-all := $(core-y) $(libs-y) | |||
563 | # Rule to link busybox - also used during CONFIG_KALLSYMS | 563 | # Rule to link busybox - also used during CONFIG_KALLSYMS |
564 | # May be overridden by arch/$(ARCH)/Makefile | 564 | # May be overridden by arch/$(ARCH)/Makefile |
565 | quiet_cmd_busybox__ ?= LINK $@ | 565 | quiet_cmd_busybox__ ?= LINK $@ |
566 | ifdef CONFIG_STATIC | ||
567 | cmd_busybox__ ?= $(srctree)/scripts/trylink $(CC) \ | ||
568 | -static \ | ||
569 | -o $@ \ | ||
570 | -Wl,--warn-common -Wl,--sort-common -Wl,--gc-sections \ | ||
571 | -Wl,--start-group $(busybox-all) -Wl,--end-group | ||
572 | else | ||
566 | cmd_busybox__ ?= $(srctree)/scripts/trylink $(CC) -o $@ \ | 573 | cmd_busybox__ ?= $(srctree)/scripts/trylink $(CC) -o $@ \ |
567 | -Wl,--warn-common -Wl,--sort-common -Wl,--gc-sections \ | 574 | -Wl,--warn-common -Wl,--sort-common -Wl,--gc-sections \ |
568 | -Wl,--start-group $(busybox-all) -Wl,--end-group \ | 575 | -Wl,--start-group $(busybox-all) -Wl,--end-group |
576 | endif | ||
569 | 577 | ||
570 | # Generate System.map | 578 | # Generate System.map |
571 | quiet_cmd_sysmap = SYSMAP | 579 | quiet_cmd_sysmap = SYSMAP |
diff --git a/archival/libunarchive/data_extract_all.c b/archival/libunarchive/data_extract_all.c index b1c66a4a2..67f8f3534 100644 --- a/archival/libunarchive/data_extract_all.c +++ b/archival/libunarchive/data_extract_all.c | |||
@@ -14,15 +14,18 @@ void data_extract_all(archive_handle_t *archive_handle) | |||
14 | 14 | ||
15 | if (archive_handle->flags & ARCHIVE_CREATE_LEADING_DIRS) { | 15 | if (archive_handle->flags & ARCHIVE_CREATE_LEADING_DIRS) { |
16 | char *name = xstrdup(file_header->name); | 16 | char *name = xstrdup(file_header->name); |
17 | bb_make_directory (dirname(name), -1, FILEUTILS_RECUR); | 17 | bb_make_directory(dirname(name), -1, FILEUTILS_RECUR); |
18 | free(name); | 18 | free(name); |
19 | } | 19 | } |
20 | 20 | ||
21 | /* Check if the file already exists */ | 21 | /* Check if the file already exists */ |
22 | if (archive_handle->flags & ARCHIVE_EXTRACT_UNCONDITIONAL) { | 22 | if (archive_handle->flags & ARCHIVE_EXTRACT_UNCONDITIONAL) { |
23 | /* Remove the existing entry if it exists */ | 23 | /* Remove the existing entry if it exists */ |
24 | if (((file_header->mode & S_IFMT) != S_IFDIR) && (unlink(file_header->name) == -1) && (errno != ENOENT)) { | 24 | if (((file_header->mode & S_IFMT) != S_IFDIR) |
25 | bb_perror_msg_and_die("Couldnt remove old file"); | 25 | && (unlink(file_header->name) == -1) |
26 | && (errno != ENOENT) | ||
27 | ) { | ||
28 | bb_perror_msg_and_die("cannot remove old file"); | ||
26 | } | 29 | } |
27 | } | 30 | } |
28 | else if (archive_handle->flags & ARCHIVE_EXTRACT_NEWER) { | 31 | else if (archive_handle->flags & ARCHIVE_EXTRACT_NEWER) { |
@@ -30,64 +33,77 @@ void data_extract_all(archive_handle_t *archive_handle) | |||
30 | struct stat statbuf; | 33 | struct stat statbuf; |
31 | if (lstat(file_header->name, &statbuf) == -1) { | 34 | if (lstat(file_header->name, &statbuf) == -1) { |
32 | if (errno != ENOENT) { | 35 | if (errno != ENOENT) { |
33 | bb_perror_msg_and_die("Couldnt stat old file"); | 36 | bb_perror_msg_and_die("cannot stat old file"); |
34 | } | 37 | } |
35 | } | 38 | } |
36 | else if (statbuf.st_mtime <= file_header->mtime) { | 39 | else if (statbuf.st_mtime <= file_header->mtime) { |
37 | if (!(archive_handle->flags & ARCHIVE_EXTRACT_QUIET)) { | 40 | if (!(archive_handle->flags & ARCHIVE_EXTRACT_QUIET)) { |
38 | bb_error_msg("%s not created: newer or same age file exists", file_header->name); | 41 | bb_error_msg("%s not created: newer or " |
42 | "same age file exists", file_header->name); | ||
39 | } | 43 | } |
40 | data_skip(archive_handle); | 44 | data_skip(archive_handle); |
41 | return; | 45 | return; |
42 | } | 46 | } |
43 | else if ((unlink(file_header->name) == -1) && (errno != EISDIR)) { | 47 | else if ((unlink(file_header->name) == -1) && (errno != EISDIR)) { |
44 | bb_perror_msg_and_die("Couldnt remove old file %s", file_header->name); | 48 | bb_perror_msg_and_die("cannot remove old file %s", |
49 | file_header->name); | ||
45 | } | 50 | } |
46 | } | 51 | } |
47 | 52 | ||
48 | /* Handle hard links separately | 53 | /* Handle hard links separately |
49 | * We identified hard links as regular files of size 0 with a symlink */ | 54 | * We identified hard links as regular files of size 0 with a symlink */ |
50 | if (S_ISREG(file_header->mode) && (file_header->link_name) && (file_header->size == 0)) { | 55 | if (S_ISREG(file_header->mode) && (file_header->link_name) |
56 | && (file_header->size == 0) | ||
57 | ) { | ||
51 | /* hard link */ | 58 | /* hard link */ |
52 | res = link(file_header->link_name, file_header->name); | 59 | res = link(file_header->link_name, file_header->name); |
53 | if ((res == -1) && !(archive_handle->flags & ARCHIVE_EXTRACT_QUIET)) { | 60 | if ((res == -1) && !(archive_handle->flags & ARCHIVE_EXTRACT_QUIET)) { |
54 | bb_perror_msg("Couldnt create hard link"); | 61 | bb_perror_msg("cannot create hard link"); |
55 | } | 62 | } |
56 | } else { | 63 | } else { |
57 | /* Create the filesystem entry */ | 64 | /* Create the filesystem entry */ |
58 | switch (file_header->mode & S_IFMT) { | 65 | switch (file_header->mode & S_IFMT) { |
59 | case S_IFREG: { | 66 | case S_IFREG: { |
60 | /* Regular file */ | 67 | /* Regular file */ |
61 | dst_fd = xopen3(file_header->name, O_WRONLY | O_CREAT | O_EXCL, | 68 | dst_fd = xopen3(file_header->name, O_WRONLY | O_CREAT | O_EXCL, |
62 | file_header->mode); | 69 | file_header->mode); |
63 | bb_copyfd_size(archive_handle->src_fd, dst_fd, file_header->size); | 70 | bb_copyfd_size(archive_handle->src_fd, dst_fd, file_header->size); |
64 | close(dst_fd); | 71 | close(dst_fd); |
65 | break; | 72 | break; |
66 | } | 73 | } |
67 | case S_IFDIR: | 74 | case S_IFDIR: |
68 | res = mkdir(file_header->name, file_header->mode); | 75 | res = mkdir(file_header->name, file_header->mode); |
69 | if ((errno != EISDIR) && (res == -1) && !(archive_handle->flags & ARCHIVE_EXTRACT_QUIET)) { | 76 | if ((errno != EISDIR) && (res == -1) |
70 | bb_perror_msg("extract_archive: %s", file_header->name); | 77 | && !(archive_handle->flags & ARCHIVE_EXTRACT_QUIET) |
71 | } | 78 | ) { |
72 | break; | 79 | bb_perror_msg("extract_archive: %s", file_header->name); |
73 | case S_IFLNK: | 80 | } |
74 | /* Symlink */ | 81 | break; |
75 | res = symlink(file_header->link_name, file_header->name); | 82 | case S_IFLNK: |
76 | if ((res == -1) && !(archive_handle->flags & ARCHIVE_EXTRACT_QUIET)) { | 83 | /* Symlink */ |
77 | bb_perror_msg("Cannot create symlink from %s to '%s'", file_header->name, file_header->link_name); | 84 | res = symlink(file_header->link_name, file_header->name); |
78 | } | 85 | if ((res == -1) |
79 | break; | 86 | && !(archive_handle->flags & ARCHIVE_EXTRACT_QUIET) |
80 | case S_IFSOCK: | 87 | ) { |
81 | case S_IFBLK: | 88 | bb_perror_msg("cannot create symlink " |
82 | case S_IFCHR: | 89 | "from %s to '%s'", |
83 | case S_IFIFO: | 90 | file_header->name, |
84 | res = mknod(file_header->name, file_header->mode, file_header->device); | 91 | file_header->link_name); |
85 | if ((res == -1) && !(archive_handle->flags & ARCHIVE_EXTRACT_QUIET)) { | 92 | } |
86 | bb_perror_msg("Cannot create node %s", file_header->name); | 93 | break; |
87 | } | 94 | case S_IFSOCK: |
88 | break; | 95 | case S_IFBLK: |
89 | default: | 96 | case S_IFCHR: |
90 | bb_error_msg_and_die("Unrecognised file type"); | 97 | case S_IFIFO: |
98 | res = mknod(file_header->name, file_header->mode, file_header->device); | ||
99 | if ((res == -1) | ||
100 | && !(archive_handle->flags & ARCHIVE_EXTRACT_QUIET) | ||
101 | ) { | ||
102 | bb_perror_msg("cannot create node %s", file_header->name); | ||
103 | } | ||
104 | break; | ||
105 | default: | ||
106 | bb_error_msg_and_die("unrecognized file type"); | ||
91 | } | 107 | } |
92 | } | 108 | } |
93 | 109 | ||
diff --git a/archival/libunarchive/get_header_cpio.c b/archival/libunarchive/get_header_cpio.c index bc766c6aa..56862f137 100644 --- a/archival/libunarchive/get_header_cpio.c +++ b/archival/libunarchive/get_header_cpio.c | |||
@@ -61,13 +61,13 @@ char get_header_cpio(archive_handle_t *archive_handle) | |||
61 | } | 61 | } |
62 | 62 | ||
63 | { | 63 | { |
64 | unsigned long tmpsize; | 64 | unsigned long tmpsize; |
65 | sscanf(cpio_header, "%6c%8x%8x%8x%8x%8x%8lx%8lx%16c%8x%8x%8x%8c", | 65 | sscanf(cpio_header, "%6c%8x%8x%8x%8x%8x%8lx%8lx%16c%8x%8x%8x%8c", |
66 | dummy, &inode, (unsigned int*)&file_header->mode, | 66 | dummy, &inode, (unsigned int*)&file_header->mode, |
67 | (unsigned int*)&file_header->uid, (unsigned int*)&file_header->gid, | 67 | (unsigned int*)&file_header->uid, (unsigned int*)&file_header->gid, |
68 | &nlink, &file_header->mtime, &tmpsize, | 68 | &nlink, &file_header->mtime, &tmpsize, |
69 | dummy, &major, &minor, &namesize, dummy); | 69 | dummy, &major, &minor, &namesize, dummy); |
70 | file_header->size = tmpsize; | 70 | file_header->size = tmpsize; |
71 | } | 71 | } |
72 | 72 | ||
73 | file_header->name = (char *) xzalloc(namesize + 1); | 73 | file_header->name = (char *) xzalloc(namesize + 1); |
diff --git a/archival/libunarchive/get_header_tar.c b/archival/libunarchive/get_header_tar.c index d3cd96d0c..f78377e28 100644 --- a/archival/libunarchive/get_header_tar.c +++ b/archival/libunarchive/get_header_tar.c | |||
@@ -74,12 +74,12 @@ char get_header_tar(archive_handle_t *archive_handle) | |||
74 | */ | 74 | */ |
75 | if (strncmp(tar.formatted.magic, "ustar", 5) != 0) { | 75 | if (strncmp(tar.formatted.magic, "ustar", 5) != 0) { |
76 | #ifdef CONFIG_FEATURE_TAR_OLDGNU_COMPATIBILITY | 76 | #ifdef CONFIG_FEATURE_TAR_OLDGNU_COMPATIBILITY |
77 | if (strncmp(tar.formatted.magic, "\0\0\0\0\0", 5) != 0) | 77 | if (memcmp(tar.formatted.magic, "\0\0\0\0", 5) != 0) |
78 | #endif | 78 | #endif |
79 | bb_error_msg_and_die("invalid tar magic"); | 79 | bb_error_msg_and_die("invalid tar magic"); |
80 | } | 80 | } |
81 | /* Do checksum on headers */ | 81 | /* Do checksum on headers */ |
82 | for (i = 0; i < 148 ; i++) { | 82 | for (i = 0; i < 148 ; i++) { |
83 | sum += tar.raw[i]; | 83 | sum += tar.raw[i]; |
84 | } | 84 | } |
85 | sum += ' ' * 8; | 85 | sum += ' ' * 8; |
@@ -111,13 +111,14 @@ char get_header_tar(archive_handle_t *archive_handle) | |||
111 | 111 | ||
112 | file_header->uid = xstrtoul(tar.formatted.uid, 8); | 112 | file_header->uid = xstrtoul(tar.formatted.uid, 8); |
113 | file_header->gid = xstrtoul(tar.formatted.gid, 8); | 113 | file_header->gid = xstrtoul(tar.formatted.gid, 8); |
114 | // TODO: LFS support | 114 | file_header->size = XSTRTOUOFF(tar.formatted.size, 8); |
115 | file_header->size = xstrtoul(tar.formatted.size, 8); | ||
116 | file_header->mtime = xstrtoul(tar.formatted.mtime, 8); | 115 | file_header->mtime = xstrtoul(tar.formatted.mtime, 8); |
117 | file_header->link_name = tar.formatted.linkname[0] ? | 116 | file_header->link_name = tar.formatted.linkname[0] ? |
118 | xstrdup(tar.formatted.linkname) : NULL; | 117 | xstrdup(tar.formatted.linkname) : NULL; |
119 | file_header->device = makedev(xstrtoul(tar.formatted.devmajor, 8), | 118 | if (tar.formatted.devmajor[0]) { |
120 | xstrtoul(tar.formatted.devminor, 8)); | 119 | file_header->device = makedev(xstrtoul(tar.formatted.devmajor, 8), |
120 | xstrtoul(tar.formatted.devminor, 8)); | ||
121 | } | ||
121 | 122 | ||
122 | /* Set bits 0-11 of the files mode */ | 123 | /* Set bits 0-11 of the files mode */ |
123 | file_header->mode = 07777 & xstrtoul(tar.formatted.mode, 8); | 124 | file_header->mode = 07777 & xstrtoul(tar.formatted.mode, 8); |
diff --git a/archival/libunarchive/init_handle.c b/archival/libunarchive/init_handle.c index 96bb1dbc9..beda1b462 100644 --- a/archival/libunarchive/init_handle.c +++ b/archival/libunarchive/init_handle.c | |||
@@ -3,8 +3,8 @@ | |||
3 | * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. | 3 | * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. |
4 | */ | 4 | */ |
5 | 5 | ||
6 | #include <unistd.h> | 6 | //#include <unistd.h> |
7 | #include <string.h> | 7 | //#include <string.h> |
8 | #include "libbb.h" | 8 | #include "libbb.h" |
9 | #include "unarchive.h" | 9 | #include "unarchive.h" |
10 | 10 | ||
@@ -12,7 +12,7 @@ archive_handle_t *init_handle(void) | |||
12 | { | 12 | { |
13 | archive_handle_t *archive_handle; | 13 | archive_handle_t *archive_handle; |
14 | 14 | ||
15 | /* Initialise default values */ | 15 | /* Initialize default values */ |
16 | archive_handle = xzalloc(sizeof(archive_handle_t)); | 16 | archive_handle = xzalloc(sizeof(archive_handle_t)); |
17 | archive_handle->file_header = xmalloc(sizeof(file_header_t)); | 17 | archive_handle->file_header = xmalloc(sizeof(file_header_t)); |
18 | archive_handle->action_header = header_skip; | 18 | archive_handle->action_header = header_skip; |
@@ -20,5 +20,5 @@ archive_handle_t *init_handle(void) | |||
20 | archive_handle->filter = filter_accept_all; | 20 | archive_handle->filter = filter_accept_all; |
21 | archive_handle->seek = seek_by_jump; | 21 | archive_handle->seek = seek_by_jump; |
22 | 22 | ||
23 | return(archive_handle); | 23 | return archive_handle; |
24 | } | 24 | } |
diff --git a/e2fsprogs/e2p/Kbuild b/e2fsprogs/e2p/Kbuild index 64e462170..c0ff824e3 100644 --- a/e2fsprogs/e2p/Kbuild +++ b/e2fsprogs/e2p/Kbuild | |||
@@ -5,9 +5,9 @@ | |||
5 | # Licensed under the GPL v2, see the file LICENSE in this tarball. | 5 | # Licensed under the GPL v2, see the file LICENSE in this tarball. |
6 | 6 | ||
7 | NEEDED-$(CONFIG_CHATTR) = y | 7 | NEEDED-$(CONFIG_CHATTR) = y |
8 | NEEDED-$(LSATTR) = y | 8 | NEEDED-$(CONFIG_LSATTR) = y |
9 | NEEDED-$(MKE2FS) = y | 9 | NEEDED-$(CONFIG_MKE2FS) = y |
10 | NEEDED-$(TUNE2FS) = y | 10 | NEEDED-$(CONFIG_TUNE2FS) = y |
11 | 11 | ||
12 | lib-y:= | 12 | lib-y:= |
13 | lib-$(NEEDED-y) += fgetsetflags.o fgetsetversion.o pf.o iod.o mntopts.o \ | 13 | lib-$(NEEDED-y) += fgetsetflags.o fgetsetversion.o pf.o iod.o mntopts.o \ |
diff --git a/include/libbb.h b/include/libbb.h index 7b9b83908..e4e67aa5a 100644 --- a/include/libbb.h +++ b/include/libbb.h | |||
@@ -89,23 +89,27 @@ | |||
89 | /* "long" is long enough on this system */ | 89 | /* "long" is long enough on this system */ |
90 | # define STRTOOFF strtol | 90 | # define STRTOOFF strtol |
91 | # define SAFE_STRTOOFF safe_strtol | 91 | # define SAFE_STRTOOFF safe_strtol |
92 | # define XSTRTOUOFF xstrtoul | ||
92 | # define OFF_FMT "%ld" | 93 | # define OFF_FMT "%ld" |
93 | # else | 94 | # else |
94 | /* "long" is too short, need "lomg long" */ | 95 | /* "long" is too short, need "long long" */ |
95 | # define STRTOOFF strtoll | 96 | # define STRTOOFF strtoll |
96 | # define SAFE_STRTOOFF safe_strtoll | 97 | # define SAFE_STRTOOFF safe_strtoll |
98 | # define XSTRTOUOFF xstrtoull | ||
97 | # define OFF_FMT "%lld" | 99 | # define OFF_FMT "%lld" |
98 | # endif | 100 | # endif |
99 | #else | 101 | #else |
100 | # if 0 /* UINT_MAX == 0xffffffff */ | 102 | # if 0 /* #if UINT_MAX == 0xffffffff */ |
101 | /* Doesn't work. off_t is a long. gcc will throw warnings on printf("%d", off_t) | 103 | /* Doesn't work. off_t is a long. gcc will throw warnings on printf("%d", off_t) |
102 | * even if long==int on this arch. Crap... */ | 104 | * even if long==int on this arch. Crap... */ |
103 | # define STRTOOFF strtol | 105 | # define STRTOOFF strtol |
104 | # define SAFE_STRTOOFF safe_strtoi | 106 | # define SAFE_STRTOOFF safe_strtoi |
107 | # define XSTRTOUOFF xstrtou | ||
105 | # define OFF_FMT "%d" | 108 | # define OFF_FMT "%d" |
106 | # else | 109 | # else |
107 | # define STRTOOFF strtol | 110 | # define STRTOOFF strtol |
108 | # define SAFE_STRTOOFF safe_strtol | 111 | # define SAFE_STRTOOFF safe_strtol |
112 | # define XSTRTOUOFF xstrtoul | ||
109 | # define OFF_FMT "%ld" | 113 | # define OFF_FMT "%ld" |
110 | # endif | 114 | # endif |
111 | #endif | 115 | #endif |
@@ -313,6 +317,8 @@ struct suffix_mult { | |||
313 | unsigned int mult; | 317 | unsigned int mult; |
314 | }; | 318 | }; |
315 | 319 | ||
320 | unsigned long long xstrtoull(const char *numstr, int base); | ||
321 | unsigned long long xatoull(const char *numstr); | ||
316 | unsigned long xstrtoul_range_sfx(const char *numstr, int base, | 322 | unsigned long xstrtoul_range_sfx(const char *numstr, int base, |
317 | unsigned long lower, | 323 | unsigned long lower, |
318 | unsigned long upper, | 324 | unsigned long upper, |
@@ -331,7 +337,6 @@ unsigned long xatoul_range(const char *numstr, | |||
331 | unsigned long lower, | 337 | unsigned long lower, |
332 | unsigned long upper); | 338 | unsigned long upper); |
333 | unsigned long xatoul(const char *numstr); | 339 | unsigned long xatoul(const char *numstr); |
334 | unsigned long long xatoull(const char *numstr); | ||
335 | long xstrtol_range_sfx(const char *numstr, int base, | 340 | long xstrtol_range_sfx(const char *numstr, int base, |
336 | long lower, | 341 | long lower, |
337 | long upper, | 342 | long upper, |
diff --git a/libbb/xatol.c b/libbb/xatol.c index 3316c3d06..1b71e9ca8 100644 --- a/libbb/xatol.c +++ b/libbb/xatol.c | |||
@@ -9,7 +9,7 @@ | |||
9 | 9 | ||
10 | #include "libbb.h" | 10 | #include "libbb.h" |
11 | 11 | ||
12 | unsigned long long xatoull(const char *numstr) | 12 | unsigned long long xstrtoull(const char *numstr, int base) |
13 | { | 13 | { |
14 | unsigned long long r; | 14 | unsigned long long r; |
15 | int old_errno; | 15 | int old_errno; |
@@ -18,7 +18,7 @@ unsigned long long xatoull(const char *numstr) | |||
18 | bb_error_msg_and_die("invalid number '%s'", numstr); | 18 | bb_error_msg_and_die("invalid number '%s'", numstr); |
19 | old_errno = errno; | 19 | old_errno = errno; |
20 | errno = 0; | 20 | errno = 0; |
21 | r = strtoull(numstr, &e, 10); | 21 | r = strtoull(numstr, &e, base); |
22 | if (errno || (numstr == e) || *e) | 22 | if (errno || (numstr == e) || *e) |
23 | /* Error / no digits / illegal trailing chars */ | 23 | /* Error / no digits / illegal trailing chars */ |
24 | bb_error_msg_and_die("invalid number '%s'", numstr); | 24 | bb_error_msg_and_die("invalid number '%s'", numstr); |
@@ -27,6 +27,11 @@ unsigned long long xatoull(const char *numstr) | |||
27 | return r; | 27 | return r; |
28 | } | 28 | } |
29 | 29 | ||
30 | unsigned long long xatoull(const char *numstr) | ||
31 | { | ||
32 | return xstrtoull(numstr, 10); | ||
33 | } | ||
34 | |||
30 | unsigned long xstrtoul_range_sfx(const char *numstr, int base, | 35 | unsigned long xstrtoul_range_sfx(const char *numstr, int base, |
31 | unsigned long lower, | 36 | unsigned long lower, |
32 | unsigned long upper, | 37 | unsigned long upper, |
diff --git a/modutils/Config.in b/modutils/Config.in index b28c66d24..c8bd61996 100644 --- a/modutils/Config.in +++ b/modutils/Config.in | |||
@@ -43,7 +43,7 @@ config FEATURE_INSMOD_LOADINKMEM | |||
43 | config FEATURE_INSMOD_LOAD_MAP | 43 | config FEATURE_INSMOD_LOAD_MAP |
44 | bool "Enable load map (-m) option" | 44 | bool "Enable load map (-m) option" |
45 | default n | 45 | default n |
46 | depends on INSMOD && FEATURE_2_4_MODULES | 46 | depends on INSMOD && ( FEATURE_2_4_MODULES || FEATURE_2_6_MODULES ) |
47 | help | 47 | help |
48 | Enabling this, one would be able to get a load map | 48 | Enabling this, one would be able to get a load map |
49 | output on stdout. This makes kernel module debugging | 49 | output on stdout. This makes kernel module debugging |
diff --git a/networking/wget.c b/networking/wget.c index 74feccc36..264ae4483 100644 --- a/networking/wget.c +++ b/networking/wget.c | |||
@@ -31,7 +31,9 @@ static int ftpcmd(char *s1, char *s2, FILE *fp, char *buf); | |||
31 | /* Globals (can be accessed from signal handlers */ | 31 | /* Globals (can be accessed from signal handlers */ |
32 | static off_t content_len; /* Content-length of the file */ | 32 | static off_t content_len; /* Content-length of the file */ |
33 | static off_t beg_range; /* Range at which continue begins */ | 33 | static off_t beg_range; /* Range at which continue begins */ |
34 | #ifdef CONFIG_FEATURE_WGET_STATUSBAR | ||
34 | static off_t transferred; /* Number of bytes transferred so far */ | 35 | static off_t transferred; /* Number of bytes transferred so far */ |
36 | #endif | ||
35 | static int chunked; /* chunked transfer encoding */ | 37 | static int chunked; /* chunked transfer encoding */ |
36 | #ifdef CONFIG_FEATURE_WGET_STATUSBAR | 38 | #ifdef CONFIG_FEATURE_WGET_STATUSBAR |
37 | static void progressmeter(int flag); | 39 | static void progressmeter(int flag); |
diff --git a/runit/chpst.c b/runit/chpst.c index 5f30b8815..1b6f37849 100644 --- a/runit/chpst.c +++ b/runit/chpst.c | |||
@@ -223,7 +223,7 @@ int chpst_main(int argc, char **argv) | |||
223 | 223 | ||
224 | { | 224 | { |
225 | char *m,*d,*o,*p,*f,*c,*r,*t,*n; | 225 | char *m,*d,*o,*p,*f,*c,*r,*t,*n; |
226 | getopt32(argc, argv, "u:U:e:m:d:o:p:f:c:r:t:/:n:vP012", | 226 | getopt32(argc, argv, "+u:U:e:m:d:o:p:f:c:r:t:/:n:vP012", |
227 | &set_user,&env_user,&env_dir, | 227 | &set_user,&env_user,&env_dir, |
228 | &m,&d,&o,&p,&f,&c,&r,&t,&root,&n); | 228 | &m,&d,&o,&p,&f,&c,&r,&t,&root,&n); |
229 | // if (option_mask32 & 0x1) // -u | 229 | // if (option_mask32 & 0x1) // -u |
@@ -310,7 +310,7 @@ static void envdir(int argc, char **argv) | |||
310 | static void softlimit(int argc, char **argv) | 310 | static void softlimit(int argc, char **argv) |
311 | { | 311 | { |
312 | char *a,*c,*d,*f,*l,*m,*o,*p,*r,*s,*t; | 312 | char *a,*c,*d,*f,*l,*m,*o,*p,*r,*s,*t; |
313 | getopt32(argc, argv, "a:c:d:f:l:m:o:p:r:s:t:", | 313 | getopt32(argc, argv, "+a:c:d:f:l:m:o:p:r:s:t:", |
314 | &a,&c,&d,&f,&l,&m,&o,&p,&r,&s,&t); | 314 | &a,&c,&d,&f,&l,&m,&o,&p,&r,&s,&t); |
315 | if (option_mask32 & 0x001) limita = xatoul(a); // -a | 315 | if (option_mask32 & 0x001) limita = xatoul(a); // -a |
316 | if (option_mask32 & 0x002) limitc = xatoul(c); // -c | 316 | if (option_mask32 & 0x002) limitc = xatoul(c); // -c |
diff --git a/shell/ash.c b/shell/ash.c index 3564044b2..1260d5e9a 100644 --- a/shell/ash.c +++ b/shell/ash.c | |||
@@ -12542,7 +12542,7 @@ static int | |||
12542 | letcmd(int argc, char **argv) | 12542 | letcmd(int argc, char **argv) |
12543 | { | 12543 | { |
12544 | char **ap; | 12544 | char **ap; |
12545 | arith_t i; | 12545 | arith_t i = 0; |
12546 | 12546 | ||
12547 | ap = argv + 1; | 12547 | ap = argv + 1; |
12548 | if(!*ap) | 12548 | if(!*ap) |