Have tincctl notify a running tincd of configuration file changes.

This commit is contained in:
Guus Sliepen 2012-07-15 20:59:17 +02:00
parent eb01fd9625
commit 439069bda6

View file

@ -1163,6 +1163,12 @@ static int cmd_config(int argc, char *argv[]) {
return 1; return 1;
} }
// Silently try notifying a running tincd of changes.
fclose(stderr);
if(connect_tincd())
sendline(fd, "%d %d", CONTROL, REQ_RELOAD);
return 0; return 0;
} }
@ -1319,7 +1325,17 @@ static int cmd_edit(int argc, char *argv[]) {
char *command; char *command;
xasprintf(&command, "\"%s\" \"%s\"", editor, filename); xasprintf(&command, "\"%s\" \"%s\"", editor, filename);
return system(command); int result = system(command);
if(result)
return result;
// Silently try notifying a running tincd of changes.
fclose(stderr);
if(connect_tincd())
sendline(fd, "%d %d", CONTROL, REQ_RELOAD);
return 0;
} }
static const struct { static const struct {