diff rvinterf/lowlevel/localsock.c @ 187:f5f8776f7c66

rvinterf: added -s option for changing the local socket pathname
author Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
date Sun, 24 Nov 2013 23:25:59 +0000
parents ec040f521cc2
children 549e6cd1e77d
line wrap: on
line diff
--- a/rvinterf/lowlevel/localsock.c	Sun Nov 24 23:18:30 2013 +0000
+++ b/rvinterf/lowlevel/localsock.c	Sun Nov 24 23:25:59 2013 +0000
@@ -13,12 +13,11 @@
 #include "../localsock.h"
 #include "client.h"
 
-static char sockpath[] = "/tmp/rvinterf_socket";
-
 int listener;
 
 extern struct client *client_head;
 extern int max_fd;
+extern char *socket_pathname;
 
 create_listener_socket()
 {
@@ -34,7 +33,7 @@
 	}
 
 	local.sun_family = AF_UNIX;
-	strncpy(local.sun_path, sockpath, sizeof(local.sun_path));
+	strncpy(local.sun_path, socket_pathname, sizeof(local.sun_path));
 	local.sun_path[sizeof(local.sun_path) - 1] = '\0';
 	unlink(local.sun_path);