From d590e2186b4cf573cd24cb9f0efaa5cb12c98b03 Mon Sep 17 00:00:00 2001 From: Michael Tatarinov Date: Mon, 27 Jun 2011 11:33:23 +0400 Subject: Removed duplicate code. Signed-off-by: Eric S. Raymond --- gpsdctl.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'gpsdctl.c') diff --git a/gpsdctl.c b/gpsdctl.c index 10ce96df..1c9a0473 100644 --- a/gpsdctl.c +++ b/gpsdctl.c @@ -14,8 +14,9 @@ #include #include #include +#include -#include "gpsd.h" /* only for the strlcpy() prototype */ +#include "gpsd.h" static char *control_socket = "/var/run/gpsd.sock"; static char *gpsd_options = ""; @@ -31,7 +32,7 @@ static int gpsd_control(char *action, char *argument) (void)syslog(LOG_ERR, "socket %s doesn't exist", control_socket); return -1; } - connect = netlib_localsocket(control_socket); + connect = netlib_localsocket(control_socket, SOCK_STREAM); if (connect >= 0) syslog(LOG_INFO, "reached a running gpsd"); else if (strcmp(action, "add") == 0) { @@ -42,7 +43,7 @@ static int gpsd_control(char *action, char *argument) (void)syslog(LOG_ERR, "launch of gpsd failed"); return -1; } - connect = netlib_localsocket(control_socket); + connect = netlib_localsocket(control_socket, SOCK_STREAM); } if (connect < 0) { syslog(LOG_ERR, "can't reach gpsd"); -- cgit v1.2.1