lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Sun, 19 Jun 2011 22:44:39 -0700
From:	matt mooney <mfm@...eddisk.com>
To:	Greg KH <greg@...ah.com>
Cc:	linux-usb@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH 09/22] staging: usbip: userspace: usbip: modify command failure

When a bad option is given, display a message stating such and output
usage. When a bad command is given, output command help.

Signed-off-by: matt mooney <mfm@...eddisk.com>
---
 drivers/staging/usbip/userspace/src/usbip.c |   13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/usbip/userspace/src/usbip.c b/drivers/staging/usbip/userspace/src/usbip.c
index cdfe4c2..583b179 100644
--- a/drivers/staging/usbip/userspace/src/usbip.c
+++ b/drivers/staging/usbip/userspace/src/usbip.c
@@ -125,13 +125,13 @@ static int usbip_version(int argc, char *argv[])
 	(void) argc;
 	(void) argv;
 
-	printf("%s\n", usbip_version_string);
+	printf(PROGNAME " (%s)\n", usbip_version_string);
 	return 0;
 }
 
 static int run_command(const struct command *cmd, int argc, char *argv[])
 {
-	dbg("running command: `%s'\n", cmd->name);
+	dbg("running command: `%s'", cmd->name);
 	return cmd->fn(argc, argv);
 }
 
@@ -163,8 +163,11 @@ int main(int argc, char *argv[])
 			usbip_use_syslog = 1;
 			openlog("", LOG_PID, LOG_USER);
 			break;
+		case '?':
+			printf("usbip: invalid option\n");
 		default:
-			goto err_out;
+			usbip_usage();
+			goto out;
 		}
 	}
 
@@ -180,8 +183,8 @@ int main(int argc, char *argv[])
 			}
 	}
 
-err_out:
-	usbip_usage();
+	/* invalid command */
+	usbip_help(0, NULL);
 out:
 	return (rc > -1 ? EXIT_SUCCESS : EXIT_FAILURE);
 }
-- 
1.7.5.2

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ