gracefully fail if d-modem helper cannot be launched

This commit is contained in:
vr5 2021-11-12 00:55:37 +03:00 committed by Jerry
parent 1aed143ceb
commit 9613917cf4
Signed by: Jerry
GPG key ID: 22618F758B5BE2E5

View file

@ -635,7 +635,12 @@ static int socket_start (struct modem *m)
char str[16];
snprintf(str,sizeof(str),"%d",sockets[0]);
close(sockets[1]);
execl(modem_exec,modem_exec,m->dial_string,str,NULL);
ret = execl(modem_exec,modem_exec,m->dial_string,str,NULL);
if (ret == -1) {
ERR("prog: %s\n", modem_exec);
perror("execl");
exit(-1);
}
} else {
close(sockets[0]);
dev->fd = sockets[1];