summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2011-11-19 10:07:32 -0800
committerAlan Coopersmith <alan.coopersmith@oracle.com>2011-12-09 17:35:52 -0800
commit638496507882f0afe506fe294f68ad5290ef95db (patch)
tree9e7d4bb4d88dc59ad08f60c671d9821c43998e65
parent9f350d75a4553d8e2bc365f8de4110bb79ec7b32 (diff)
Move variable declarations to get rid of unnecessary scope brackets
Gets rid of one of the multiple levels of bracketing that confusingly shared the same indent level. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: James Cloos <cloos@jhcloos.com>
-rw-r--r--src/sm_genid.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/sm_genid.c b/src/sm_genid.c
index 700bbf2..2d87527 100644
--- a/src/sm_genid.c
+++ b/src/sm_genid.c
@@ -151,11 +151,6 @@ SmsGenerateClientID(SmsConn smsConn)
char temp[256];
char *id;
static int sequence = 0;
-
- if (gethostname (hostname, sizeof (hostname)))
- return (NULL);
-
- {
char* inet_addr;
char *ptr1;
unsigned char decimal[4];
@@ -163,6 +158,12 @@ SmsGenerateClientID(SmsConn smsConn)
struct in_addr *haddr = NULL;
# if defined(IPv6) && defined(AF_INET6)
struct addrinfo *ai, *first_ai;
+# endif
+
+ if (gethostname (hostname, sizeof (hostname)))
+ return (NULL);
+
+# if defined(IPv6) && defined(AF_INET6)
if (getaddrinfo(hostname,NULL,NULL,&ai) != 0)
return NULL;
@@ -235,7 +236,6 @@ SmsGenerateClientID(SmsConn smsConn)
}
freeaddrinfo(first_ai);
# endif
- }
sprintf (temp, "1%s%.13ld%.10ld%.4d", address, (long)time((Time_t*)0),
(long)getpid(), sequence);