diff options
author | Jonas Gunz <himself@jonasgunz.de> | 2019-06-28 09:56:35 +0200 |
---|---|---|
committer | Jonas Gunz <himself@jonasgunz.de> | 2019-06-28 09:56:35 +0200 |
commit | 2b7ba240be298d1d7ffc7d220b83e22a7c4f8c43 (patch) | |
tree | 891d8efb554d51c7535306b7dae80af997104cca /src/modem.c | |
parent | f6ac29dceebb32afc27c2e93294b3c7bb8b2f66f (diff) | |
download | bbs-2b7ba240be298d1d7ffc7d220b83e22a7c4f8c43.tar.gz |
Minor fixes, documentation
Diffstat (limited to 'src/modem.c')
-rw-r--r-- | src/modem.c | 6 |
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); } } |