c2d5d21
From f0d81b5ea1170274c57be7ee7989dc7bb0b64b84 Mon Sep 17 00:00:00 2001
c2d5d21
From: Lee Duncan <lduncan@suse.com>
c2d5d21
Date: Wed, 26 Jun 2013 11:57:39 -0700
c2d5d21
Subject: Fix discovery error return without return value
c2d5d21
c2d5d21
openSUSE Build Service compiler noticed that one discovery
c2d5d21
error path did not have a return value, so an appropriate
c2d5d21
error is now being returned.
c2d5d21
c2d5d21
Signed-of-by: Lee Duncan <lduncan@suse.com>
c2d5d21
---
c2d5d21
 include/iscsi_err.h | 2 ++
c2d5d21
 usr/iscsiadm.c      | 1 +
c2d5d21
 2 files changed, 3 insertions(+)
c2d5d21
c2d5d21
diff --git a/include/iscsi_err.h b/include/iscsi_err.h
c2d5d21
index 1139133..125f443 100644
c2d5d21
--- a/include/iscsi_err.h
c2d5d21
+++ b/include/iscsi_err.h
c2d5d21
@@ -64,6 +64,8 @@ enum {
c2d5d21
 	ISCSI_ERR_BUSY			= 28,
c2d5d21
 	/* Operation failed, but retrying layer may succeed */
c2d5d21
 	ISCSI_ERR_AGAIN			= 29,
c2d5d21
+	/* unknown discovery type */
c2d5d21
+	ISCSI_ERR_UNKNOWN_DISCOVERY_TYPE = 30,
c2d5d21
 
c2d5d21
 	/* Always last. Indicates end of error code space */
c2d5d21
 	ISCSI_MAX_ERR_VAL,
c2d5d21
diff --git a/usr/iscsiadm.c b/usr/iscsiadm.c
c2d5d21
index 84d5a27..5030894 100644
c2d5d21
--- a/usr/iscsiadm.c
c2d5d21
+++ b/usr/iscsiadm.c
c2d5d21
@@ -1235,6 +1235,7 @@ sw_discovery:
c2d5d21
 		return do_isns(drec, ifaces, info_level, do_login, op);
c2d5d21
 	default:
c2d5d21
 		log_debug(1, "Unknown Discovery Type : %d\n", drec->type);
c2d5d21
+		return ISCSI_ERR_UNKNOWN_DISCOVERY_TYPE;
c2d5d21
 	}
c2d5d21
 }
c2d5d21
 
c2d5d21
-- 
c2d5d21
1.8.1.4
c2d5d21