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 f3c4dfb2eb
commit b86058be12
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];