[PATCH 05/12] commands/mount: Return real error code if "mount" fail

Sascha Hauer s.hauer at pengutronix.de
Wed Apr 23 02:47:50 PDT 2014


On Sat, Apr 12, 2014 at 12:10:58PM +0400, Alexander Shiyan wrote:
> Signed-off-by: Alexander Shiyan <shc_work at mail.ru>
> ---
>  commands/mount.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/commands/mount.c b/commands/mount.c
> index 691bc29..77efe71 100644
> --- a/commands/mount.c
> +++ b/commands/mount.c
> @@ -115,7 +115,7 @@ static int do_mount(int argc, char *argv[])
>  
>  	if ((ret = mount(dev, type, mountpoint, fsoptions))) {
>  		perror("mount");
> -		return 1;
> +		return ret;

The perror() should be removed then. Otherwise we get the same error
message twice.

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



More information about the barebox mailing list