[PATCH 1/2] commands/mount: Return real error code if "mount" fail

Alexander Shiyan shc_work at mail.ru
Sat Apr 26 03:40:09 PDT 2014


Signed-off-by: Alexander Shiyan <shc_work at mail.ru>
---
 commands/mount.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/commands/mount.c b/commands/mount.c
index 691bc29..8629bac 100644
--- a/commands/mount.c
+++ b/commands/mount.c
@@ -31,8 +31,7 @@
 
 static int do_mount(int argc, char *argv[])
 {
-	int opt;
-	int ret = 0, verbose = 0;
+	int opt, verbose = 0;
 	struct driver_d *drv;
 	const char *type = NULL;
 	const char *mountpoint, *dev;
@@ -113,11 +112,7 @@ static int do_mount(int argc, char *argv[])
 		mountpoint = argv[optind + 1];
 	}
 
-	if ((ret = mount(dev, type, mountpoint, fsoptions))) {
-		perror("mount");
-		return 1;
-	}
-	return 0;
+	return mount(dev, type, mountpoint, fsoptions);
 }
 
 BAREBOX_CMD_HELP_START(mount)
-- 
1.8.3.2




More information about the barebox mailing list