Compare commits

..

No commits in common. "1384f907657f729a3b07b50dc0924767b1399ae6" and "415d0b7a8569c8d43a6b21ab9bba98e2d6c5c1de" have entirely different histories.

2 changed files with 4 additions and 10 deletions

2
d3d.rc Executable file → Normal file
View file

@ -9,5 +9,5 @@ fct 32
statusfile d3d/irena-status
datafile d3d/irena-%Y-%m-%dT%H:%M:%SZ.dat
counterfile d3d/irena-%Y-%m-%dT%H:%M:%SZ.hst
socket unix irena-control interactive force
socket unix irena-control interactive
cron next init 60 irena pres/inj

12
irena.c
View file

@ -2372,11 +2372,6 @@ void print_asocket(FILE *mout)
int open_cmd_socket(int na, char **av)
{
int force = 0;
if (!strcmp(av[na-1], "force")) {
na--;
force = 1;
}
if (!strcmp(av[na-1], "close")) {
na--;
close_cmd_socket();
@ -2407,8 +2402,6 @@ int open_cmd_socket(int na, char **av)
else if (na==2 || na==3 && !strcmp(av[1], "unix")) {
cmd_socket_addr.u.sun_family = AF_UNIX;
strncpy(cmd_socket_addr.u.sun_path, av[na-1], sizeof(cmd_socket_addr.u.sun_path)-1);
if (force && !unlink(cmd_socket_addr.u.sun_path))
fprintf(mout, "socket «%s» unlinked\n", cmd_socket_addr.u.sun_path);
}
else if (na==1) {
is_open:
@ -2429,10 +2422,11 @@ int open_cmd_socket(int na, char **av)
merror("socket");
return -1;
}
if (force && cmd_socket_is_inet())
if (cmd_socket_is_inet())
setsockopt(cmd_socket_fd, SOL_SOCKET, SO_REUSEADDR, &(int){1}, sizeof(int));
if (bind(cmd_socket_fd, &cmd_socket_addr.g, sizeof(cmd_socket_addr.u))<0) {
merror("bind");
goto error;
}
@ -2726,7 +2720,7 @@ int process_cmd(char *l)
"\tstatusfile [«fn» [ «rotate» [ «rotate-modulus» [«flags»]]]] [close|rotate]\n"
"\tdatarate [«index» [«rate» [«i-rate» [«burst» [«flags»]]]]] [reset]\n"
"\tlimits «index» [ «red-low» «yellow-low» «yellow-high» «red-high» ]\n"
"\tsocket [unix «path»|tcp «port»] [interactive|noninteractive] [close] [force]\n"
"\tsocket [unix «path»|tcp «port»] [interactive|noninteractive] [close]\n"
"\tpath [«name» [«value»]]\n"
"\tcron [«index» [«flags»… [«delay» «cmd»]]]\n"
"\tcron force «flags»… [«times»]\n"