[PATCH 2/7] change return value of isns_show() and isns_update() to tgtadm_err

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Alexander Nezhinsky <alexandern@xxxxxxxxxxxx>


Signed-off-by: Alexander Nezhinsky <alexandern@xxxxxxxxxxxx>
---
 usr/iscsi/iscsid.h |    4 ++--
 usr/iscsi/isns.c   |   14 +++++++-------
 2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/usr/iscsi/iscsid.h b/usr/iscsi/iscsid.h
index b815b8c..897ff63 100644
--- a/usr/iscsi/iscsid.h
+++ b/usr/iscsi/iscsid.h
@@ -354,8 +354,8 @@ extern void iscsi_exit(void);
 /* isns.c */
 extern int isns_init(void);
 extern void isns_exit(void);
-extern int isns_show(struct concat_buf *b);
-extern int isns_update(char *params);
+extern tgtadm_err isns_show(struct concat_buf *b);
+extern tgtadm_err isns_update(char *params);
 extern int isns_scn_access(int tid, char *name);
 extern int isns_target_register(char *name);
 extern int isns_target_deregister(char *name);
diff --git a/usr/iscsi/isns.c b/usr/iscsi/isns.c
index 78ba13e..1bbc9c1 100644
--- a/usr/iscsi/isns.c
+++ b/usr/iscsi/isns.c
@@ -1066,7 +1066,7 @@ void isns_exit(void)
 	free(rxbuf);
 }
 
-int isns_show(struct concat_buf *b)
+tgtadm_err isns_show(struct concat_buf *b)
 {
 	concat_printf(b, "iSNS:\n");
 	concat_printf(b, _TAB1 "iSNS=%s\n", use_isns ? "On" : "Off");
@@ -1091,9 +1091,9 @@ static match_table_t tokens = {
 	{Opt_err, NULL},
 };
 
-int isns_update(char *params)
+tgtadm_err isns_update(char *params)
 {
-	int ret = 0;
+    tgtadm_err adm_err = TGTADM_SUCCESS;
 	char *p;
 
 	while ((p = strsep(&params, ",")) != NULL) {
@@ -1113,7 +1113,7 @@ int isns_update(char *params)
 			else if (!strcmp(tmp, "Off"))
 				isns = 0;
 			else {
-				ret = TGTADM_INVALID_REQUEST;
+				adm_err = TGTADM_INVALID_REQUEST;
 				break;
 			}
 			if (use_isns == isns)
@@ -1128,7 +1128,7 @@ int isns_update(char *params)
 			break;
 		case Opt_port:
 			if (match_int(&args[0], &isns_port))
-				ret = TGTADM_INVALID_REQUEST;
+				adm_err = TGTADM_INVALID_REQUEST;
 			break;
 		case Opt_ac:
 			match_strncpy(tmp, &args[0], sizeof(tmp));
@@ -1139,9 +1139,9 @@ int isns_update(char *params)
 			system_set_state(tmp);
 			break;
 		default:
-			ret = TGTADM_INVALID_REQUEST;
+			adm_err = TGTADM_INVALID_REQUEST;
 		}
 	}
 
-	return ret;
+	return adm_err;
 }
-- 
1.7.9.6

--
To unsubscribe from this list: send the line "unsubscribe stgt" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux SCSI]     [Linux RAID]     [Linux Clusters]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]

  Powered by Linux