aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2012-05-28 02:48:55 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2012-05-28 02:48:55 +0200
commitaa4e5092f58f5a11018e569aee9cf037daf8c5d6 (patch)
treef8c01df8f7eb3dda4c0292df3548d9fced5e3297
parentf5234398ef3010b68468cafe3e2ea89b2bb08a17 (diff)
downloadbusybox-w32-1_20_1.tar.gz
busybox-w32-1_20_1.tar.bz2
busybox-w32-1_20_1.zip
Apply post-1.20.0 patches, bump version to 1.20.11_20_1
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--Makefile2
-rw-r--r--archival/libarchive/Kbuild.src4
-rw-r--r--editors/sed.c6
-rw-r--r--findutils/find.c10
-rw-r--r--libbb/lineedit.c6
-rw-r--r--loginutils/getty.c6
-rw-r--r--util-linux/mdev.c41
-rw-r--r--util-linux/volume_id/ext.c52
8 files changed, 95 insertions, 32 deletions
diff --git a/Makefile b/Makefile
index d5beb0459..1de03983f 100644
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,6 @@
1VERSION = 1 1VERSION = 1
2PATCHLEVEL = 20 2PATCHLEVEL = 20
3SUBLEVEL = 0 3SUBLEVEL = 1
4EXTRAVERSION = 4EXTRAVERSION =
5NAME = Unnamed 5NAME = Unnamed
6 6
diff --git a/archival/libarchive/Kbuild.src b/archival/libarchive/Kbuild.src
index 959221789..58457fc22 100644
--- a/archival/libarchive/Kbuild.src
+++ b/archival/libarchive/Kbuild.src
@@ -45,7 +45,7 @@ lib-$(CONFIG_UNXZ) += decompress_unxz.o
45lib-$(CONFIG_CPIO) += get_header_cpio.o 45lib-$(CONFIG_CPIO) += get_header_cpio.o
46lib-$(CONFIG_DPKG) += $(DPKG_FILES) 46lib-$(CONFIG_DPKG) += $(DPKG_FILES)
47lib-$(CONFIG_DPKG_DEB) += $(DPKG_FILES) 47lib-$(CONFIG_DPKG_DEB) += $(DPKG_FILES)
48lib-$(CONFIG_GUNZIP) += decompress_gunzip.o 48lib-$(CONFIG_GUNZIP) += open_transformer.o decompress_gunzip.o
49lib-$(CONFIG_RPM2CPIO) += decompress_gunzip.o get_header_cpio.o 49lib-$(CONFIG_RPM2CPIO) += decompress_gunzip.o get_header_cpio.o
50lib-$(CONFIG_RPM) += open_transformer.o decompress_gunzip.o get_header_cpio.o 50lib-$(CONFIG_RPM) += open_transformer.o decompress_gunzip.o get_header_cpio.o
51lib-$(CONFIG_TAR) += get_header_tar.o 51lib-$(CONFIG_TAR) += get_header_tar.o
@@ -60,7 +60,7 @@ lib-$(CONFIG_FEATURE_SEAMLESS_GZ) += open_transformer.o decompress_gunzip.
60lib-$(CONFIG_FEATURE_SEAMLESS_BZ2) += open_transformer.o decompress_bunzip2.o 60lib-$(CONFIG_FEATURE_SEAMLESS_BZ2) += open_transformer.o decompress_bunzip2.o
61lib-$(CONFIG_FEATURE_SEAMLESS_LZMA) += open_transformer.o decompress_unlzma.o 61lib-$(CONFIG_FEATURE_SEAMLESS_LZMA) += open_transformer.o decompress_unlzma.o
62lib-$(CONFIG_FEATURE_SEAMLESS_XZ) += open_transformer.o decompress_unxz.o 62lib-$(CONFIG_FEATURE_SEAMLESS_XZ) += open_transformer.o decompress_unxz.o
63lib-$(CONFIG_FEATURE_COMPRESS_USAGE) += decompress_bunzip2.o 63lib-$(CONFIG_FEATURE_COMPRESS_USAGE) += open_transformer.o decompress_bunzip2.o
64lib-$(CONFIG_FEATURE_COMPRESS_BBCONFIG) += decompress_bunzip2.o 64lib-$(CONFIG_FEATURE_COMPRESS_BBCONFIG) += decompress_bunzip2.o
65lib-$(CONFIG_FEATURE_TAR_TO_COMMAND) += data_extract_to_command.o 65lib-$(CONFIG_FEATURE_TAR_TO_COMMAND) += data_extract_to_command.o
66 66
diff --git a/editors/sed.c b/editors/sed.c
index 4e9babb9d..3ee8edc43 100644
--- a/editors/sed.c
+++ b/editors/sed.c
@@ -743,7 +743,7 @@ static int do_subst_command(sed_cmd_t *sed_cmd, char **line_p)
743 */ 743 */
744 if (!G.regmatch[0].rm_so && !G.regmatch[0].rm_eo && match_count) { 744 if (!G.regmatch[0].rm_so && !G.regmatch[0].rm_eo && match_count) {
745 pipe_putc(*line++); 745 pipe_putc(*line++);
746 continue; 746 goto next;
747 } 747 }
748 748
749 match_count++; 749 match_count++;
@@ -755,7 +755,7 @@ static int do_subst_command(sed_cmd_t *sed_cmd, char **line_p)
755 ) { 755 ) {
756 for (i = 0; i < G.regmatch[0].rm_eo; i++) 756 for (i = 0; i < G.regmatch[0].rm_eo; i++)
757 pipe_putc(*line++); 757 pipe_putc(*line++);
758 continue; 758 goto next;
759 } 759 }
760 760
761 /* print everything before the match */ 761 /* print everything before the match */
@@ -773,7 +773,7 @@ static int do_subst_command(sed_cmd_t *sed_cmd, char **line_p)
773 /* if we're not doing this globally, get out now */ 773 /* if we're not doing this globally, get out now */
774 if (sed_cmd->which_match != 0) 774 if (sed_cmd->which_match != 0)
775 break; 775 break;
776 776 next:
777 if (*line == '\0') 777 if (*line == '\0')
778 break; 778 break;
779 779
diff --git a/findutils/find.c b/findutils/find.c
index fc0fc5c9f..0ec5bdfea 100644
--- a/findutils/find.c
+++ b/findutils/find.c
@@ -831,6 +831,11 @@ static action*** parse_params(char **argv)
831 PARM_name , 831 PARM_name ,
832 PARM_iname , 832 PARM_iname ,
833 IF_FEATURE_FIND_PATH( PARM_path ,) 833 IF_FEATURE_FIND_PATH( PARM_path ,)
834#if ENABLE_DESKTOP
835 /* -wholename is a synonym for -path */
836 /* We support it because Linux kernel's "make tags" uses it */
837 IF_FEATURE_FIND_PATH( PARM_wholename ,)
838#endif
834 IF_FEATURE_FIND_PATH( PARM_ipath ,) 839 IF_FEATURE_FIND_PATH( PARM_ipath ,)
835 IF_FEATURE_FIND_REGEX( PARM_regex ,) 840 IF_FEATURE_FIND_REGEX( PARM_regex ,)
836 IF_FEATURE_FIND_TYPE( PARM_type ,) 841 IF_FEATURE_FIND_TYPE( PARM_type ,)
@@ -869,6 +874,9 @@ static action*** parse_params(char **argv)
869 "-name\0" 874 "-name\0"
870 "-iname\0" 875 "-iname\0"
871 IF_FEATURE_FIND_PATH( "-path\0" ) 876 IF_FEATURE_FIND_PATH( "-path\0" )
877#if ENABLE_DESKTOP
878 IF_FEATURE_FIND_PATH( "-wholename\0")
879#endif
872 IF_FEATURE_FIND_PATH( "-ipath\0" ) 880 IF_FEATURE_FIND_PATH( "-ipath\0" )
873 IF_FEATURE_FIND_REGEX( "-regex\0" ) 881 IF_FEATURE_FIND_REGEX( "-regex\0" )
874 IF_FEATURE_FIND_TYPE( "-type\0" ) 882 IF_FEATURE_FIND_TYPE( "-type\0" )
@@ -1076,7 +1084,7 @@ static action*** parse_params(char **argv)
1076 ap->iname = (parm == PARM_iname); 1084 ap->iname = (parm == PARM_iname);
1077 } 1085 }
1078#if ENABLE_FEATURE_FIND_PATH 1086#if ENABLE_FEATURE_FIND_PATH
1079 else if (parm == PARM_path || parm == PARM_ipath) { 1087 else if (parm == PARM_path IF_DESKTOP(|| parm == PARM_wholename) || parm == PARM_ipath) {
1080 action_path *ap; 1088 action_path *ap;
1081 dbg("%d", __LINE__); 1089 dbg("%d", __LINE__);
1082 ap = ALLOC_ACTION(path); 1090 ap = ALLOC_ACTION(path);
diff --git a/libbb/lineedit.c b/libbb/lineedit.c
index db8416712..b89748a1c 100644
--- a/libbb/lineedit.c
+++ b/libbb/lineedit.c
@@ -1352,8 +1352,7 @@ static void load_history(line_input_t *st_parm)
1352 /* fill temp_h[], retaining only last MAX_HISTORY lines */ 1352 /* fill temp_h[], retaining only last MAX_HISTORY lines */
1353 memset(temp_h, 0, sizeof(temp_h)); 1353 memset(temp_h, 0, sizeof(temp_h));
1354 idx = 0; 1354 idx = 0;
1355 if (!ENABLE_FEATURE_EDITING_SAVE_ON_EXIT) 1355 st_parm->cnt_history_in_file = 0;
1356 st_parm->cnt_history_in_file = 0;
1357 while ((line = xmalloc_fgetline(fp)) != NULL) { 1356 while ((line = xmalloc_fgetline(fp)) != NULL) {
1358 if (line[0] == '\0') { 1357 if (line[0] == '\0') {
1359 free(line); 1358 free(line);
@@ -1361,8 +1360,7 @@ static void load_history(line_input_t *st_parm)
1361 } 1360 }
1362 free(temp_h[idx]); 1361 free(temp_h[idx]);
1363 temp_h[idx] = line; 1362 temp_h[idx] = line;
1364 if (!ENABLE_FEATURE_EDITING_SAVE_ON_EXIT) 1363 st_parm->cnt_history_in_file++;
1365 st_parm->cnt_history_in_file++;
1366 idx++; 1364 idx++;
1367 if (idx == st_parm->max_history) 1365 if (idx == st_parm->max_history)
1368 idx = 0; 1366 idx = 0;
diff --git a/loginutils/getty.c b/loginutils/getty.c
index afb411b98..bbb5a96b4 100644
--- a/loginutils/getty.c
+++ b/loginutils/getty.c
@@ -561,8 +561,14 @@ int getty_main(int argc UNUSED_PARAM, char **argv)
561 */ 561 */
562 fd = open("/dev/tty", O_RDWR | O_NONBLOCK); 562 fd = open("/dev/tty", O_RDWR | O_NONBLOCK);
563 if (fd >= 0) { 563 if (fd >= 0) {
564 /* TIOCNOTTY sends SIGHUP to the foreground
565 * process group - which may include us!
566 * Make sure to not die on it:
567 */
568 sighandler_t old = signal(SIGHUP, SIG_IGN);
564 ioctl(fd, TIOCNOTTY); 569 ioctl(fd, TIOCNOTTY);
565 close(fd); 570 close(fd);
571 signal(SIGHUP, old);
566 } 572 }
567 } 573 }
568 574
diff --git a/util-linux/mdev.c b/util-linux/mdev.c
index 0a34122b4..c4829a596 100644
--- a/util-linux/mdev.c
+++ b/util-linux/mdev.c
@@ -661,37 +661,45 @@ static int FAST_FUNC dirAction(const char *fileName UNUSED_PARAM,
661static void load_firmware(const char *firmware, const char *sysfs_path) 661static void load_firmware(const char *firmware, const char *sysfs_path)
662{ 662{
663 int cnt; 663 int cnt;
664 int firmware_fd, loading_fd, data_fd; 664 int firmware_fd, loading_fd;
665 665
666 /* check for /lib/firmware/$FIRMWARE */ 666 /* check for /lib/firmware/$FIRMWARE */
667 xchdir("/lib/firmware"); 667 xchdir("/lib/firmware");
668 firmware_fd = xopen(firmware, O_RDONLY); 668 firmware_fd = open(firmware, O_RDONLY); /* can fail */
669
670 /* in case we goto out ... */
671 data_fd = -1;
672 669
673 /* check for /sys/$DEVPATH/loading ... give 30 seconds to appear */ 670 /* check for /sys/$DEVPATH/loading ... give 30 seconds to appear */
674 xchdir(sysfs_path); 671 xchdir(sysfs_path);
675 for (cnt = 0; cnt < 30; ++cnt) { 672 for (cnt = 0; cnt < 30; ++cnt) {
676 loading_fd = open("loading", O_WRONLY); 673 loading_fd = open("loading", O_WRONLY);
677 if (loading_fd != -1) 674 if (loading_fd >= 0)
678 goto loading; 675 goto loading;
679 sleep(1); 676 sleep(1);
680 } 677 }
681 goto out; 678 goto out;
682 679
683 loading: 680 loading:
684 /* tell kernel we're loading by "echo 1 > /sys/$DEVPATH/loading" */ 681 cnt = 0;
685 if (full_write(loading_fd, "1", 1) != 1) 682 if (firmware_fd >= 0) {
686 goto out; 683 int data_fd;
687 684
688 /* load firmware into /sys/$DEVPATH/data */ 685 /* tell kernel we're loading by "echo 1 > /sys/$DEVPATH/loading" */
689 data_fd = open("data", O_WRONLY); 686 if (full_write(loading_fd, "1", 1) != 1)
690 if (data_fd == -1) 687 goto out;
691 goto out; 688
692 cnt = bb_copyfd_eof(firmware_fd, data_fd); 689 /* load firmware into /sys/$DEVPATH/data */
690 data_fd = open("data", O_WRONLY);
691 if (data_fd < 0)
692 goto out;
693 cnt = bb_copyfd_eof(firmware_fd, data_fd);
694 if (ENABLE_FEATURE_CLEAN_UP)
695 close(data_fd);
696 }
693 697
694 /* tell kernel result by "echo [0|-1] > /sys/$DEVPATH/loading" */ 698 /* Tell kernel result by "echo [0|-1] > /sys/$DEVPATH/loading"
699 * Note: we emit -1 if firmware file wasn't found.
700 * There are cases when otherwise kernel would wait for minutes
701 * before timing out.
702 */
695 if (cnt > 0) 703 if (cnt > 0)
696 full_write(loading_fd, "0", 1); 704 full_write(loading_fd, "0", 1);
697 else 705 else
@@ -701,7 +709,6 @@ static void load_firmware(const char *firmware, const char *sysfs_path)
701 if (ENABLE_FEATURE_CLEAN_UP) { 709 if (ENABLE_FEATURE_CLEAN_UP) {
702 close(firmware_fd); 710 close(firmware_fd);
703 close(loading_fd); 711 close(loading_fd);
704 close(data_fd);
705 } 712 }
706} 713}
707 714
diff --git a/util-linux/volume_id/ext.c b/util-linux/volume_id/ext.c
index b5194a7b5..aa23d1ebf 100644
--- a/util-linux/volume_id/ext.c
+++ b/util-linux/volume_id/ext.c
@@ -39,10 +39,50 @@ struct ext2_super_block {
39 uint8_t volume_name[16]; 39 uint8_t volume_name[16];
40} PACKED; 40} PACKED;
41 41
42#define EXT3_FEATURE_COMPAT_HAS_JOURNAL 0x00000004
43#define EXT3_FEATURE_INCOMPAT_JOURNAL_DEV 0x00000008
44#define EXT_SUPERBLOCK_OFFSET 0x400 42#define EXT_SUPERBLOCK_OFFSET 0x400
45 43
44/* for s_flags */
45#define EXT2_FLAGS_TEST_FILESYS 0x0004
46
47/* for s_feature_compat */
48#define EXT3_FEATURE_COMPAT_HAS_JOURNAL 0x0004
49
50/* for s_feature_ro_compat */
51#define EXT2_FEATURE_RO_COMPAT_SPARSE_SUPER 0x0001
52#define EXT2_FEATURE_RO_COMPAT_LARGE_FILE 0x0002
53#define EXT2_FEATURE_RO_COMPAT_BTREE_DIR 0x0004
54#define EXT4_FEATURE_RO_COMPAT_HUGE_FILE 0x0008
55#define EXT4_FEATURE_RO_COMPAT_GDT_CSUM 0x0010
56#define EXT4_FEATURE_RO_COMPAT_DIR_NLINK 0x0020
57#define EXT4_FEATURE_RO_COMPAT_EXTRA_ISIZE 0x0040
58
59/* for s_feature_incompat */
60#define EXT2_FEATURE_INCOMPAT_FILETYPE 0x0002
61#define EXT3_FEATURE_INCOMPAT_RECOVER 0x0004
62#define EXT3_FEATURE_INCOMPAT_JOURNAL_DEV 0x0008
63#define EXT2_FEATURE_INCOMPAT_META_BG 0x0010
64#define EXT4_FEATURE_INCOMPAT_EXTENTS 0x0040 /* extents support */
65#define EXT4_FEATURE_INCOMPAT_64BIT 0x0080
66#define EXT4_FEATURE_INCOMPAT_MMP 0x0100
67#define EXT4_FEATURE_INCOMPAT_FLEX_BG 0x0200
68
69#define EXT2_FEATURE_RO_COMPAT_SUPP (EXT2_FEATURE_RO_COMPAT_SPARSE_SUPER| \
70 EXT2_FEATURE_RO_COMPAT_LARGE_FILE| \
71 EXT2_FEATURE_RO_COMPAT_BTREE_DIR)
72#define EXT2_FEATURE_INCOMPAT_SUPP (EXT2_FEATURE_INCOMPAT_FILETYPE| \
73 EXT2_FEATURE_INCOMPAT_META_BG)
74#define EXT2_FEATURE_INCOMPAT_UNSUPPORTED ~EXT2_FEATURE_INCOMPAT_SUPP
75#define EXT2_FEATURE_RO_COMPAT_UNSUPPORTED ~EXT2_FEATURE_RO_COMPAT_SUPP
76
77#define EXT3_FEATURE_RO_COMPAT_SUPP (EXT2_FEATURE_RO_COMPAT_SPARSE_SUPER| \
78 EXT2_FEATURE_RO_COMPAT_LARGE_FILE| \
79 EXT2_FEATURE_RO_COMPAT_BTREE_DIR)
80#define EXT3_FEATURE_INCOMPAT_SUPP (EXT2_FEATURE_INCOMPAT_FILETYPE| \
81 EXT3_FEATURE_INCOMPAT_RECOVER| \
82 EXT2_FEATURE_INCOMPAT_META_BG)
83#define EXT3_FEATURE_INCOMPAT_UNSUPPORTED ~EXT3_FEATURE_INCOMPAT_SUPP
84#define EXT3_FEATURE_RO_COMPAT_UNSUPPORTED ~EXT3_FEATURE_RO_COMPAT_SUPP
85
46int FAST_FUNC volume_id_probe_ext(struct volume_id *id /*,uint64_t off*/) 86int FAST_FUNC volume_id_probe_ext(struct volume_id *id /*,uint64_t off*/)
47{ 87{
48#define off ((uint64_t)0) 88#define off ((uint64_t)0)
@@ -66,11 +106,15 @@ int FAST_FUNC volume_id_probe_ext(struct volume_id *id /*,uint64_t off*/)
66 dbg("ext: label '%s' uuid '%s'", id->label, id->uuid); 106 dbg("ext: label '%s' uuid '%s'", id->label, id->uuid);
67 107
68#if ENABLE_FEATURE_BLKID_TYPE 108#if ENABLE_FEATURE_BLKID_TYPE
69 if ((le32_to_cpu(es->feature_compat) & EXT3_FEATURE_COMPAT_HAS_JOURNAL) != 0) 109 if ((es->feature_ro_compat & cpu_to_le32(EXT4_FEATURE_RO_COMPAT_HUGE_FILE | EXT4_FEATURE_RO_COMPAT_DIR_NLINK))
110 || (es->feature_incompat & cpu_to_le32(EXT4_FEATURE_INCOMPAT_EXTENTS | EXT4_FEATURE_INCOMPAT_64BIT))
111 ) {
112 id->type = "ext4";
113 }
114 else if (es->feature_compat & cpu_to_le32(EXT3_FEATURE_COMPAT_HAS_JOURNAL))
70 id->type = "ext3"; 115 id->type = "ext3";
71 else 116 else
72 id->type = "ext2"; 117 id->type = "ext2";
73#endif 118#endif
74
75 return 0; 119 return 0;
76} 120}