summaryrefslogtreecommitdiff
path: root/gpsdctl.c
diff options
context:
space:
mode:
authorMichael Tatarinov <kukabu@gmail.com>2011-06-27 11:33:23 +0400
committerEric S. Raymond <esr@thyrsus.com>2011-06-27 03:38:52 -0400
commitd590e2186b4cf573cd24cb9f0efaa5cb12c98b03 (patch)
treef9b6679760578b5c42e423c8c7bb00bd633fb1b4 /gpsdctl.c
parent1dcbdc6955748a97611b59bf8e1d3a49f18fdb83 (diff)
downloadgpsd-d590e2186b4cf573cd24cb9f0efaa5cb12c98b03.tar.gz
Removed duplicate code.
Signed-off-by: Eric S. Raymond <esr@thyrsus.com>
Diffstat (limited to 'gpsdctl.c')
-rw-r--r--gpsdctl.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/gpsdctl.c b/gpsdctl.c
index 10ce96df..1c9a0473 100644
--- a/gpsdctl.c
+++ b/gpsdctl.c
@@ -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");