[stgt] [PATCH 7/7] change return value of iqn_acl_add() and iqn_acl_del() to tgtadm_err

nezhinsky at gmail.com nezhinsky at gmail.com
Fri May 18 12:24:29 CEST 2012


From: Alexander Nezhinsky <alexandern at mellanox.com>


Signed-off-by: Alexander Nezhinsky <alexandern at mellanox.com>
---
 usr/target.c |   12 ++++++------
 usr/tgtd.h   |    4 ++--
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/usr/target.c b/usr/target.c
index d9aa92a..68222a0 100644
--- a/usr/target.c
+++ b/usr/target.c
@@ -1588,7 +1588,7 @@ char *acl_get(int tid, int idx)
 	return NULL;
 }
 
-int iqn_acl_add(int tid, char *name)
+tgtadm_err iqn_acl_add(int tid, char *name)
 {
 	char *str;
 	struct target *target;
@@ -1615,14 +1615,14 @@ int iqn_acl_add(int tid, char *name)
 	iqn_acl->name = str;
 	list_add_tail(&iqn_acl->iqn_aclent_list, &target->iqn_acl_list);
 
-	return 0;
+	return TGTADM_SUCCESS;
 }
 
-int iqn_acl_del(int tid, char *name)
+tgtadm_err iqn_acl_del(int tid, char *name)
 {
 	struct target *target;
 	struct iqn_acl_entry *iqn_acl, *tmp;
-	int err = TGTADM_ACL_NOEXIST;
+	tgtadm_err adm_err = TGTADM_ACL_NOEXIST;
 
 	target = target_lookup(tid);
 	if (!target)
@@ -1633,11 +1633,11 @@ int iqn_acl_del(int tid, char *name)
 			list_del(&iqn_acl->iqn_aclent_list);
 			free(iqn_acl->name);
 			free(iqn_acl);
-			err = 0;
+			adm_err = TGTADM_SUCCESS;
 			break;
 		}
 	}
-	return err;
+	return adm_err;
 }
 
 char *iqn_acl_get(int tid, int idx)
diff --git a/usr/tgtd.h b/usr/tgtd.h
index 779d386..b303e21 100644
--- a/usr/tgtd.h
+++ b/usr/tgtd.h
@@ -307,8 +307,8 @@ extern tgtadm_err acl_add(int tid, char *address);
 extern tgtadm_err acl_del(int tid, char *address);
 extern char *acl_get(int tid, int idx);
 
-extern int iqn_acl_add(int tid, char *name);
-extern int iqn_acl_del(int tid, char *name);
+extern tgtadm_err iqn_acl_add(int tid, char *name);
+extern tgtadm_err iqn_acl_del(int tid, char *name);
 extern char *iqn_acl_get(int tid, int idx);
 
 extern int account_lookup(int tid, int type, char *user, int ulen, char *password, int plen);
-- 
1.7.9.6

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



More information about the stgt mailing list