summaryrefslogtreecommitdiffstats
path: root/package/busybox/busybox-1.15.2-split.patch
blob: 651a320e22a1d0d2a71085168cfd669f129c336e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
diff -urpN busybox-1.15.2/coreutils/split.c busybox-1.15.2-split/coreutils/split.c
--- busybox-1.15.2/coreutils/split.c	2009-10-08 02:59:09.000000000 +0200
+++ busybox-1.15.2-split/coreutils/split.c	2009-11-30 21:09:20.000000000 +0100
@@ -79,9 +79,13 @@ int split_main(int argc UNUSED_PARAM, ch
 
 	argv += optind;
 	if (argv[0]) {
+		int fd;
 		if (argv[1])
 			sfx = argv[1];
-		xmove_fd(xopen(argv[0], O_RDONLY), 0);
+		fd = open_or_warn_stdin(argv[0]);
+		if (fd == -1)
+			return EXIT_FAILURE;
+		xmove_fd(fd, STDIN_FILENO);
 	} else {
 		argv[0] = (char *) bb_msg_standard_input;
 	}