[asterisk-commits] jpeeler: branch jpeeler/externalivr-tcp r106234 - /team/jpeeler/externalivr-t...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Mar 5 16:23:01 CST 2008


Author: jpeeler
Date: Wed Mar  5 16:23:00 2008
New Revision: 106234

URL: http://svn.digium.com/view/asterisk?view=rev&rev=106234
Log:
added missing return statement and fixed some coding style

Modified:
    team/jpeeler/externalivr-tcp/apps/app_externalivr.c

Modified: team/jpeeler/externalivr-tcp/apps/app_externalivr.c
URL: http://svn.digium.com/view/asterisk/team/jpeeler/externalivr-tcp/apps/app_externalivr.c?view=diff&rev=106234&r1=106233&r2=106234
==============================================================================
--- team/jpeeler/externalivr-tcp/apps/app_externalivr.c (original)
+++ team/jpeeler/externalivr-tcp/apps/app_externalivr.c Wed Mar  5 16:23:00 2008
@@ -356,8 +356,9 @@
 		if (ast_activate_generator(chan, &gen, u) < 0) {
 			ast_chan_log(LOG_WARNING, chan, "Failed to activate generator\n");
 			goto exit;
-		} else
+		} else {
 			gen_active = 1;
+		}
 
 		ast_chan_log(LOG_DEBUG, chan, "Parsing hostname:port for socket connect from \"%s\"\n", args.cmd[0]);           
 		strncpy(hostname, args.cmd[0] + 6, sizeof(hostname));
@@ -394,8 +395,9 @@
 		if (ast_activate_generator(chan, &gen, u) < 0) {
 			ast_chan_log(LOG_WARNING, chan, "Failed to activate generator\n");
 			goto exit;
-		} else
+		} else {
 			gen_active = 1;
+		}
 	
 		pid = fork();
 		if (pid < 0) {
@@ -698,19 +700,18 @@
 	if (ast_gethostbyname(host, &hp) == NULL) {
 		return unit;
 	}
-
 	bzero((char *)&sin, sizeof(sin));
 	sin.sin_family = AF_INET;
 	bcopy((char *)hp.hp.h_addr, (char *)&sin.sin_addr.s_addr, hp.hp.h_length);
 	sin.sin_port = htons(port);
 
-	if ((unit=socket(AF_INET,SOCK_STREAM,0)) < 0) {
+	if ((unit = socket(AF_INET, SOCK_STREAM, 0)) < 0) {
 		return unit;
 	}
-	if (connect(unit,&sin,sizeof(sin)) < 0) {
-		return -1;
-	}
-	/* else unhandled? */
+	if (connect(unit, &sin, sizeof(sin)) < 0) {
+		unit = -1;
+	}
+	return(unit);
 }
 
 static int unload_module(void)




More information about the asterisk-commits mailing list