diff options
author | Michael Tatarinov <kukabu@gmail.com> | 2011-06-27 11:33:23 +0400 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2011-06-27 03:38:52 -0400 |
commit | d590e2186b4cf573cd24cb9f0efaa5cb12c98b03 (patch) | |
tree | f9b6679760578b5c42e423c8c7bb00bd633fb1b4 /gpsdctl.c | |
parent | 1dcbdc6955748a97611b59bf8e1d3a49f18fdb83 (diff) | |
download | gpsd-d590e2186b4cf573cd24cb9f0efaa5cb12c98b03.tar.gz |
Removed duplicate code.
Signed-off-by: Eric S. Raymond <esr@thyrsus.com>
Diffstat (limited to 'gpsdctl.c')
-rw-r--r-- | gpsdctl.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -14,8 +14,9 @@ #include <stdbool.h> #include <stdlib.h> #include <stdio.h> +#include <sys/socket.h> -#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"); |