diff mbox

opensm/main.c: Handle daemon mode with guid specified as 0 more gracefully

Message ID 4FFB119E.2090805@dev.mellanox.co.il (mailing list archive)
State Accepted
Delegated to: Alex Netes
Headers show

Commit Message

Hal Rosenstock July 9, 2012, 5:15 p.m. UTC
As pointed out by Philipp Thomas <pth@suse.de>:

Currently opensm will silently fail if you pass '-g 0 -B'. As you can't
ask for a port, exit with failure so admin can see the reason
for opensm's failure.

Signed-off-by: Hal Rosenstock <hal@mellanox.com>
---
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Alex Netes July 25, 2012, 7:52 a.m. UTC | #1
Hi Hal,

On 13:15 Mon 09 Jul     , Hal Rosenstock wrote:
> 
> As pointed out by Philipp Thomas <pth@suse.de>:
> 
> Currently opensm will silently fail if you pass '-g 0 -B'. As you can't
> ask for a port, exit with failure so admin can see the reason
> for opensm's failure.
> 
> Signed-off-by: Hal Rosenstock <hal@mellanox.com>
> ---

Applied, thanks.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/opensm/main.c b/opensm/main.c
index 4218cc6..fca209a 100644
--- a/opensm/main.c
+++ b/opensm/main.c
@@ -1120,8 +1120,14 @@  int main(int argc, char *argv[])
 
 	block_signals();
 
-	if (opt.daemon)
+	if (opt.daemon) {
+		if (INVALID_GUID == opt.guid) {
+			fprintf(stderr,
+				"ERROR: Invalid GUID specified; exiting because of daemon mode\n");
+			return -1;
+		}
 		daemonize(&osm);
+	}
 
 	complib_init();