From 2b7ba240be298d1d7ffc7d220b83e22a7c4f8c43 Mon Sep 17 00:00:00 2001 From: Jonas Gunz Date: Fri, 28 Jun 2019 09:56:35 +0200 Subject: Minor fixes, documentation --- src/modem.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/modem.c') diff --git a/src/modem.c b/src/modem.c index be5c9d6..31e8ee2 100644 --- a/src/modem.c +++ b/src/modem.c @@ -122,6 +122,7 @@ int modem_run(int fd, int argc, char* argv[]) dup2 (in[0], STDIN_FILENO); dup2 (out[1], STDOUT_FILENO); + dup2 (out[1], STDERR_FILENO); char *arv = malloc(sizeof(char) * (argc + 1)); memset(arv, 0, sizeof(char) * (argc + 1)); @@ -172,9 +173,10 @@ int modem_run(int fd, int argc, char* argv[]) if(cnt) { //search for modem error message char *str = strstr(buff, "NO CARRIER"); - if(str) //Exit if message found + if(str){ //Exit if message found + kill(pid,SIGTERM); break; - + } write(in[1], buff, cnt); } } -- cgit v1.2.3