git » nmdb » commit c4d4b8a

Rearrange some code so the nmdb_add_*_server() look more similar.

author Alberto Bertogli
2007-06-01 18:14:47 UTC
committer Alberto Bertogli
2007-06-01 18:14:47 UTC
parent 476848078e0ed16ae2bc66e51594cd69c0ca6c01

Rearrange some code so the nmdb_add_*_server() look more similar.

Signed-off-by: Alberto Bertogli <albertito@gmail.com>

libnmdb/libnmdb.c +3 -4

diff --git a/libnmdb/libnmdb.c b/libnmdb/libnmdb.c
index 2d44a55..286c66d 100644
--- a/libnmdb/libnmdb.c
+++ b/libnmdb/libnmdb.c
@@ -156,13 +156,12 @@ int nmdb_add_tipc_server(nmdb_t *db, int port)
 	db->servers = newarray;
 	db->nservers++;
 
-	newsrv = &(db->servers[db->nservers - 1]);
-
-	newsrv->fd = fd;
-
 	if (port < 0)
 		port = TIPC_SERVER_INST;
 
+	newsrv = &(db->servers[db->nservers - 1]);
+
+	newsrv->fd = fd;
 	newsrv->info.tipc.port = port;
 	newsrv->info.tipc.srvsa.family = AF_TIPC;
 	newsrv->info.tipc.srvsa.addrtype = TIPC_ADDR_NAMESEQ;