diff options
Diffstat (limited to 'meta/recipes-core/busybox/busybox/0001-flock-update-the-behaviour-of-c-parameter-to-match-u.patch')
-rw-r--r-- | meta/recipes-core/busybox/busybox/0001-flock-update-the-behaviour-of-c-parameter-to-match-u.patch | 64 |
1 files changed, 0 insertions, 64 deletions
diff --git a/meta/recipes-core/busybox/busybox/0001-flock-update-the-behaviour-of-c-parameter-to-match-u.patch b/meta/recipes-core/busybox/busybox/0001-flock-update-the-behaviour-of-c-parameter-to-match-u.patch deleted file mode 100644 index 78520f0d90..0000000000 --- a/meta/recipes-core/busybox/busybox/0001-flock-update-the-behaviour-of-c-parameter-to-match-u.patch +++ /dev/null | |||
@@ -1,64 +0,0 @@ | |||
1 | From e1d426fd65c00a6d01a10d85edf8a294ae8a2d2b Mon Sep 17 00:00:00 2001 | ||
2 | From: Denys Vlasenko <vda.linux@googlemail.com> | ||
3 | Date: Sun, 24 Apr 2016 18:19:49 +0200 | ||
4 | Subject: [PATCH] flock: fix -c; improve error handling of fork+exec | ||
5 | |||
6 | function old new delta | ||
7 | flock_main 254 334 +80 | ||
8 | |||
9 | Upstream-Status: Backport | ||
10 | |||
11 | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com> | ||
12 | Signed-off-by: Maxin B. John <maxin.john@intel.com> | ||
13 | --- | ||
14 | util-linux/flock.c | 19 +++++++++++++++++-- | ||
15 | 1 file changed, 17 insertions(+), 2 deletions(-) | ||
16 | |||
17 | diff --git a/util-linux/flock.c b/util-linux/flock.c | ||
18 | index 05a747f..539a835 100644 | ||
19 | --- a/util-linux/flock.c | ||
20 | +++ b/util-linux/flock.c | ||
21 | @@ -57,7 +57,6 @@ int flock_main(int argc UNUSED_PARAM, char **argv) | ||
22 | /* If it is "flock FILE -c PROG", then -c isn't caught by getopt32: | ||
23 | * we use "+" in order to support "flock -opt FILE PROG -with-opts", | ||
24 | * we need to remove -c by hand. | ||
25 | - * TODO: in upstream, -c 'PROG ARGS' means "run sh -c 'PROG ARGS'" | ||
26 | */ | ||
27 | if (argv[0] | ||
28 | && argv[0][0] == '-' | ||
29 | @@ -66,6 +65,9 @@ int flock_main(int argc UNUSED_PARAM, char **argv) | ||
30 | ) | ||
31 | ) { | ||
32 | argv++; | ||
33 | + if (argv[1]) | ||
34 | + bb_error_msg_and_die("-c takes only one argument"); | ||
35 | + opt |= OPT_c; | ||
36 | } | ||
37 | |||
38 | if (OPT_s == LOCK_SH && OPT_x == LOCK_EX && OPT_n == LOCK_NB && OPT_u == LOCK_UN) { | ||
39 | @@ -90,8 +92,21 @@ int flock_main(int argc UNUSED_PARAM, char **argv) | ||
40 | bb_perror_nomsg_and_die(); | ||
41 | } | ||
42 | |||
43 | - if (argv[0]) | ||
44 | + if (argv[0]) { | ||
45 | + if (!(opt & OPT_c)) { | ||
46 | + int rc = spawn_and_wait(argv); | ||
47 | + if (rc < 0) | ||
48 | + bb_simple_perror_msg(argv[0]); | ||
49 | + return rc; | ||
50 | + } | ||
51 | + /* -c 'PROG ARGS' means "run sh -c 'PROG ARGS'" */ | ||
52 | + argv -= 2; | ||
53 | + argv[0] = (char*)get_shell_name(); | ||
54 | + argv[1] = (char*)"-c"; | ||
55 | + /* argv[2] = "PROG ARGS"; */ | ||
56 | + /* argv[3] = NULL; */ | ||
57 | return spawn_and_wait(argv); | ||
58 | + } | ||
59 | |||
60 | return EXIT_SUCCESS; | ||
61 | } | ||
62 | -- | ||
63 | 2.4.0 | ||
64 | |||