diff options
author | Ron Yorston <rmy@pobox.com> | 2017-08-22 14:56:12 +0100 |
---|---|---|
committer | Ron Yorston <rmy@pobox.com> | 2017-08-22 14:56:12 +0100 |
commit | ce9af1cc5ea23f754587448cf35b5120c77bfeef (patch) | |
tree | 69e5eaba5e75ab909ed92d5045393471b8ff3c13 /libbb/appletlib.c | |
parent | c170026700eabb10147dd848c45c06995b43a32e (diff) | |
parent | e837a0dbbebf4229306df98fe9ee3b9bb30630c4 (diff) | |
download | busybox-w32-ce9af1cc5ea23f754587448cf35b5120c77bfeef.tar.gz busybox-w32-ce9af1cc5ea23f754587448cf35b5120c77bfeef.tar.bz2 busybox-w32-ce9af1cc5ea23f754587448cf35b5120c77bfeef.zip |
Merge branch 'busybox' into merge
Diffstat (limited to 'libbb/appletlib.c')
-rw-r--r-- | libbb/appletlib.c | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/libbb/appletlib.c b/libbb/appletlib.c index 401475f18..6330b6f8b 100644 --- a/libbb/appletlib.c +++ b/libbb/appletlib.c | |||
@@ -34,14 +34,6 @@ | |||
34 | # include <malloc.h> /* for mallopt */ | 34 | # include <malloc.h> /* for mallopt */ |
35 | #endif | 35 | #endif |
36 | 36 | ||
37 | #include <sys/prctl.h> | ||
38 | #ifndef PR_SET_NAME | ||
39 | #define PR_SET_NAME 15 | ||
40 | #endif | ||
41 | #ifndef PR_GET_NAME | ||
42 | #define PR_GET_NAME 16 | ||
43 | #endif | ||
44 | |||
45 | /* Declare <applet>_main() */ | 37 | /* Declare <applet>_main() */ |
46 | #define PROTOTYPES | 38 | #define PROTOTYPES |
47 | #include "applets.h" | 39 | #include "applets.h" |
@@ -985,8 +977,6 @@ void FAST_FUNC run_applet_no_and_exit(int applet_no, const char *name, char **ar | |||
985 | { | 977 | { |
986 | int argc = string_array_len(argv); | 978 | int argc = string_array_len(argv); |
987 | 979 | ||
988 | /* Reinit some shared global data */ | ||
989 | xfunc_error_retval = EXIT_FAILURE; | ||
990 | /* | 980 | /* |
991 | * We do not use argv[0]: do not want to repeat massaging of | 981 | * We do not use argv[0]: do not want to repeat massaging of |
992 | * "-/sbin/halt" -> "halt", for example. | 982 | * "-/sbin/halt" -> "halt", for example. |
@@ -1163,15 +1153,14 @@ int main(int argc UNUSED_PARAM, char **argv) | |||
1163 | } | 1153 | } |
1164 | applet_name = bb_basename(applet_name); | 1154 | applet_name = bb_basename(applet_name); |
1165 | 1155 | ||
1166 | # if defined(__linux__) | ||
1167 | /* If we are a result of execv("/proc/self/exe"), fix ugly comm of "exe" */ | 1156 | /* If we are a result of execv("/proc/self/exe"), fix ugly comm of "exe" */ |
1168 | if (ENABLE_FEATURE_SH_STANDALONE | 1157 | if (ENABLE_FEATURE_SH_STANDALONE |
1169 | || ENABLE_FEATURE_PREFER_APPLETS | 1158 | || ENABLE_FEATURE_PREFER_APPLETS |
1170 | || !BB_MMU | 1159 | || !BB_MMU |
1171 | ) { | 1160 | ) { |
1172 | prctl(PR_SET_NAME, (long)applet_name, 0, 0, 0); | 1161 | if (NUM_APPLETS > 1) |
1162 | set_task_comm(applet_name); | ||
1173 | } | 1163 | } |
1174 | # endif | ||
1175 | 1164 | ||
1176 | parse_config_file(); /* ...maybe, if FEATURE_SUID_CONFIG */ | 1165 | parse_config_file(); /* ...maybe, if FEATURE_SUID_CONFIG */ |
1177 | run_applet_and_exit(applet_name, argv); | 1166 | run_applet_and_exit(applet_name, argv); |