aboutsummaryrefslogtreecommitdiff
path: root/src/modem.c
diff options
context:
space:
mode:
authorGravatar Jonas Gunz <himself@jonasgunz.de> 2019-06-28 09:56:35 +0200
committerGravatar Jonas Gunz <himself@jonasgunz.de> 2019-06-28 09:56:35 +0200
commit2b7ba240be298d1d7ffc7d220b83e22a7c4f8c43 (patch)
tree891d8efb554d51c7535306b7dae80af997104cca /src/modem.c
parentf6ac29dceebb32afc27c2e93294b3c7bb8b2f66f (diff)
downloadbbs-2b7ba240be298d1d7ffc7d220b83e22a7c4f8c43.tar.gz
Minor fixes, documentation
Diffstat (limited to 'src/modem.c')
-rw-r--r--src/modem.c6
1 files changed, 4 insertions, 2 deletions
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);
}
}