Blame SOURCES/glibc-rh2065588-11.patch
|
|
87c1f6 |
commit 5a5a3a3234bc220a5192d620e0cbc5360da46f14
|
|
|
87c1f6 |
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
|
|
|
87c1f6 |
Date: Tue Mar 24 15:40:36 2020 -0300
|
|
|
87c1f6 |
|
|
|
87c1f6 |
support/shell-container.c: Add builtin exit
|
|
|
87c1f6 |
|
|
|
87c1f6 |
Reviewed-by: DJ Delorie <dj@redhat.com>
|
|
|
87c1f6 |
|
|
|
87c1f6 |
diff --git a/support/shell-container.c b/support/shell-container.c
|
|
|
87c1f6 |
index e9eea64bca7e949d..aeaf6d2733abce61 100644
|
|
|
87c1f6 |
--- a/support/shell-container.c
|
|
|
87c1f6 |
+++ b/support/shell-container.c
|
|
|
87c1f6 |
@@ -135,6 +135,18 @@ copy_func (char **argv)
|
|
|
87c1f6 |
|
|
|
87c1f6 |
}
|
|
|
87c1f6 |
|
|
|
87c1f6 |
+/* Emulate the 'exit' builtin. The exit value is optional. */
|
|
|
87c1f6 |
+static int
|
|
|
87c1f6 |
+exit_func (char **argv)
|
|
|
87c1f6 |
+{
|
|
|
87c1f6 |
+ int exit_val = 0;
|
|
|
87c1f6 |
+
|
|
|
87c1f6 |
+ if (argv[0] != 0)
|
|
|
87c1f6 |
+ exit_val = atoi (argv[0]) & 0xff;
|
|
|
87c1f6 |
+ exit (exit_val);
|
|
|
87c1f6 |
+ return 0;
|
|
|
87c1f6 |
+}
|
|
|
87c1f6 |
+
|
|
|
87c1f6 |
/* This is a list of all the built-in commands we understand. */
|
|
|
87c1f6 |
static struct {
|
|
|
87c1f6 |
const char *name;
|
|
|
87c1f6 |
@@ -143,6 +155,7 @@ static struct {
|
|
|
87c1f6 |
{ "true", true_func },
|
|
|
87c1f6 |
{ "echo", echo_func },
|
|
|
87c1f6 |
{ "cp", copy_func },
|
|
|
87c1f6 |
+ { "exit", exit_func },
|
|
|
87c1f6 |
{ NULL, NULL }
|
|
|
87c1f6 |
};
|
|
|
87c1f6 |
|