X-Git-Url: https://www.tinc-vpn.org/git/browse?p=tinc;a=blobdiff_plain;f=src%2Fuml_device.c;h=4a03bb7bae9f2716ff991c24f5d268d3c9c8f77b;hp=5c9a306e639e1ca0028403dba509aed03d593647;hb=061c3fcaf9c63978009dc2707071f8daef8751b2;hpb=3fae14fae5a347823679ef694ab630b4991a201d diff --git a/src/uml_device.c b/src/uml_device.c index 5c9a306e..4a03bb7b 100644 --- a/src/uml_device.c +++ b/src/uml_device.c @@ -35,7 +35,7 @@ static int request_fd = -1; static int data_fd = -1; static int write_fd = -1; static int state = 0; -static char *device_info; +static const char *device_info = "UML network socket"; extern char *identname; extern volatile bool running; @@ -65,13 +65,11 @@ static bool setup_device(void) { struct timeval tv; if(!get_config_string(lookup_config(config_tree, "Device"), &device)) { - xasprintf(&device, LOCALSTATEDIR "/run/%s.umlsocket", identname); + xasprintf(&device, RUNSTATEDIR "/%s.umlsocket", identname); } get_config_string(lookup_config(config_tree, "Interface"), &iface); - device_info = "UML network socket"; - if((write_fd = socket(PF_UNIX, SOCK_DGRAM, 0)) < 0) { logger(LOG_ERR, "Could not open write %s: %s", device_info, strerror(errno)); running = false;