projects
/
platform
/
upstream
/
busybox.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
libbb: introduce and use BB_EXECVP_or_die()
[platform/upstream/busybox.git]
/
libbb
/
execable.c
diff --git
a/libbb/execable.c
b/libbb/execable.c
index
5c7ac16
..
82241cd
100644
(file)
--- a/
libbb/execable.c
+++ b/
libbb/execable.c
@@
-76,3
+76,11
@@
int FAST_FUNC bb_execvp(const char *file, char *const argv[])
argv);
}
#endif
+
+int FAST_FUNC BB_EXECVP_or_die(char **argv)
+{
+ BB_EXECVP(argv[0], argv);
+ /* SUSv3-mandated exit codes */
+ xfunc_error_retval = (errno == ENOENT) ? 127 : 126;
+ bb_perror_msg_and_die("can't execute '%s'", argv[0]);
+}