mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] Documentation/sandbox: Add hint how to end a sandboxed barebox
@ 2020-01-28 14:25 Uwe Kleine-König
  2020-01-28 14:45 ` Antony Pavlov
  0 siblings, 1 reply; 5+ messages in thread
From: Uwe Kleine-König @ 2020-01-28 14:25 UTC (permalink / raw)
  To: barebox

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 Documentation/boards/sandbox.rst |  3 +++
 commands/test.c                  | 33 ++++++++++++++++----------------
 2 files changed, 20 insertions(+), 16 deletions(-)

diff --git a/Documentation/boards/sandbox.rst b/Documentation/boards/sandbox.rst
index 85a54e6b04d6..8b00093fb9f3 100644
--- a/Documentation/boards/sandbox.rst
+++ b/Documentation/boards/sandbox.rst
@@ -57,3 +57,6 @@ Available sandbox invocation options include:
   ``-y``, ``--yres <res>``
 
     Specify SDL height.
+
+To terminate barebox and return to the calling shell, the poweroff command is
+suitable.
diff --git a/commands/test.c b/commands/test.c
index 86636de1c283..f7068f757904 100644
--- a/commands/test.c
+++ b/commands/test.c
@@ -159,28 +159,29 @@ static int do_test(int argc, char *argv[])
 					break;
 				}
 				expr = 0;
-				if (opt == OPT_EXISTS) {
+				switch (opt) {
+				case OPT_EXISTS:
 					expr = 1;
 					break;
-				}
-				if (opt == OPT_FILE && S_ISREG(statbuf.st_mode)) {
-					expr = 1;
+
+				case OPT_FILE:
+					expr = S_ISREG(statbuf.st_mode);
 					break;
-				}
-				if (opt == OPT_DIRECTORY && S_ISDIR(statbuf.st_mode)) {
-					expr = 1;
+
+				case OPT_DIRECTORY:
+					expr = S_ISDIR(statbuf.st_mode);
 					break;
-				}
-				if (opt == OPT_SYMBOLIC_LINK && S_ISLNK(statbuf.st_mode)) {
-					expr = 1;
+
+				case OPT_SYMBOLIC_LINK:
+					expr = S_ISLNK(statbuf.st_mode);
 					break;
-				}
-				if (opt == OPT_BLOCK && S_ISBLK(statbuf.st_mode)) {
-					expr = 1;
+
+				case OPT_BLOCK:
+					expr = S_ISBLK(statbuf.st_mode);
 					break;
-				}
-				if (opt == OPT_CHAR && S_ISCHR(statbuf.st_mode)) {
-					expr = 1;
+
+				case OPT_CHAR:
+					expr = S_ISCHR(statbuf.st_mode);
 					break;
 				}
 			}
-- 
2.24.0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] Documentation/sandbox: Add hint how to end a sandboxed barebox
  2020-01-28 14:25 [PATCH] Documentation/sandbox: Add hint how to end a sandboxed barebox Uwe Kleine-König
@ 2020-01-28 14:45 ` Antony Pavlov
  2020-01-28 14:49   ` Uwe Kleine-König
  2020-01-28 14:52   ` [PATCH v2] " Uwe Kleine-König
  0 siblings, 2 replies; 5+ messages in thread
From: Antony Pavlov @ 2020-01-28 14:45 UTC (permalink / raw)
  To: Uwe Kleine-König; +Cc: barebox

On Tue, 28 Jan 2020 15:25:17 +0100
Uwe Kleine-König <u.kleine-koenig@pengutronix.de> wrote:

> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> ---
>  Documentation/boards/sandbox.rst |  3 +++
>  commands/test.c                  | 33 ++++++++++++++++----------------

Have changes in the commands/test.c file any relation to commit message?


>  2 files changed, 20 insertions(+), 16 deletions(-)
> 
> diff --git a/Documentation/boards/sandbox.rst b/Documentation/boards/sandbox.rst
> index 85a54e6b04d6..8b00093fb9f3 100644
> --- a/Documentation/boards/sandbox.rst
> +++ b/Documentation/boards/sandbox.rst
> @@ -57,3 +57,6 @@ Available sandbox invocation options include:
>    ``-y``, ``--yres <res>``
>  
>      Specify SDL height.
> +
> +To terminate barebox and return to the calling shell, the poweroff command is
> +suitable.
> diff --git a/commands/test.c b/commands/test.c
> index 86636de1c283..f7068f757904 100644
> --- a/commands/test.c
> +++ b/commands/test.c
> @@ -159,28 +159,29 @@ static int do_test(int argc, char *argv[])
>  					break;
>  				}
>  				expr = 0;
> -				if (opt == OPT_EXISTS) {
> +				switch (opt) {
> +				case OPT_EXISTS:
>  					expr = 1;
>  					break;
> -				}
> -				if (opt == OPT_FILE && S_ISREG(statbuf.st_mode)) {
> -					expr = 1;
> +
> +				case OPT_FILE:
> +					expr = S_ISREG(statbuf.st_mode);
>  					break;
> -				}
> -				if (opt == OPT_DIRECTORY && S_ISDIR(statbuf.st_mode)) {
> -					expr = 1;
> +
> +				case OPT_DIRECTORY:
> +					expr = S_ISDIR(statbuf.st_mode);
>  					break;
> -				}
> -				if (opt == OPT_SYMBOLIC_LINK && S_ISLNK(statbuf.st_mode)) {
> -					expr = 1;
> +
> +				case OPT_SYMBOLIC_LINK:
> +					expr = S_ISLNK(statbuf.st_mode);
>  					break;
> -				}
> -				if (opt == OPT_BLOCK && S_ISBLK(statbuf.st_mode)) {
> -					expr = 1;
> +
> +				case OPT_BLOCK:
> +					expr = S_ISBLK(statbuf.st_mode);
>  					break;
> -				}
> -				if (opt == OPT_CHAR && S_ISCHR(statbuf.st_mode)) {
> -					expr = 1;
> +
> +				case OPT_CHAR:
> +					expr = S_ISCHR(statbuf.st_mode);
>  					break;
>  				}
>  			}
> -- 
> 2.24.0
> 
> 
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox


-- 
Best regards,
  Antony Pavlov

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] Documentation/sandbox: Add hint how to end a sandboxed barebox
  2020-01-28 14:45 ` Antony Pavlov
@ 2020-01-28 14:49   ` Uwe Kleine-König
  2020-01-28 14:52   ` [PATCH v2] " Uwe Kleine-König
  1 sibling, 0 replies; 5+ messages in thread
From: Uwe Kleine-König @ 2020-01-28 14:49 UTC (permalink / raw)
  To: Antony Pavlov; +Cc: barebox

On Tue, Jan 28, 2020 at 05:45:23PM +0300, Antony Pavlov wrote:
> On Tue, 28 Jan 2020 15:25:17 +0100
> Uwe Kleine-König <u.kleine-koenig@pengutronix.de> wrote:
> 
> > Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> > ---
> >  Documentation/boards/sandbox.rst |  3 +++
> >  commands/test.c                  | 33 ++++++++++++++++----------------
> 
> Have changes in the commands/test.c file any relation to commit message?

oh, commit fsck. Thanks.

Will sort out and resend.

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH v2] Documentation/sandbox: Add hint how to end a sandboxed barebox
  2020-01-28 14:45 ` Antony Pavlov
  2020-01-28 14:49   ` Uwe Kleine-König
@ 2020-01-28 14:52   ` Uwe Kleine-König
  2020-01-29  7:46     ` Sascha Hauer
  1 sibling, 1 reply; 5+ messages in thread
From: Uwe Kleine-König @ 2020-01-28 14:52 UTC (permalink / raw)
  To: barebox

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 Documentation/boards/sandbox.rst | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/Documentation/boards/sandbox.rst b/Documentation/boards/sandbox.rst
index 85a54e6b04d6..8b00093fb9f3 100644
--- a/Documentation/boards/sandbox.rst
+++ b/Documentation/boards/sandbox.rst
@@ -57,3 +57,6 @@ Available sandbox invocation options include:
   ``-y``, ``--yres <res>``
 
     Specify SDL height.
+
+To terminate barebox and return to the calling shell, the poweroff command is
+suitable.
-- 
2.24.0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] Documentation/sandbox: Add hint how to end a sandboxed barebox
  2020-01-28 14:52   ` [PATCH v2] " Uwe Kleine-König
@ 2020-01-29  7:46     ` Sascha Hauer
  0 siblings, 0 replies; 5+ messages in thread
From: Sascha Hauer @ 2020-01-29  7:46 UTC (permalink / raw)
  To: Uwe Kleine-König; +Cc: barebox

On Tue, Jan 28, 2020 at 03:52:05PM +0100, Uwe Kleine-König wrote:
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> ---
>  Documentation/boards/sandbox.rst | 3 +++
>  1 file changed, 3 insertions(+)

Applied, thanks

Sascha

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-01-29  7:46 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-28 14:25 [PATCH] Documentation/sandbox: Add hint how to end a sandboxed barebox Uwe Kleine-König
2020-01-28 14:45 ` Antony Pavlov
2020-01-28 14:49   ` Uwe Kleine-König
2020-01-28 14:52   ` [PATCH v2] " Uwe Kleine-König
2020-01-29  7:46     ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox