From 928cea0549aa12a0f36908b5f131d2934cccc419 Mon Sep 17 00:00:00 2001 From: dcp1990 Date: Wed, 29 Jun 2005 22:02:23 +0000 Subject: [PATCH] Various pain-in-the-ass bugs. --- phonectl/phonectl.c | 6 ++++-- phoned/modem.c | 2 +- phoned/modems/rockwell.c | 4 +++- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/phonectl/phonectl.c b/phonectl/phonectl.c index 8c7cfa3..5f1b49b 100644 --- a/phonectl/phonectl.c +++ b/phonectl/phonectl.c @@ -27,10 +27,11 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ -/* $Amigan: phoned/phonectl/phonectl.c,v 1.8 2005/06/28 02:01:28 dcp1990 Exp $ */ +/* $Amigan: phoned/phonectl/phonectl.c,v 1.9 2005/06/29 22:02:23 dcp1990 Exp $ */ /* system includes */ #include #include +#include #include #include #include @@ -69,6 +70,7 @@ int main(argc, argv) exit(-1); } #endif + fcntl(fileno(stdin), F_SETFL, O_NONBLOCK); if(argc == 1) { for(;;) { FD_ZERO(&fds); @@ -82,7 +84,7 @@ int main(argc, argv) default: { if(FD_ISSET(fileno(stdin), &fds)) { - fgets(buff, 1024, stdin); + read(fileno(stdin), buff, 1024); nl = strchr(buff, '\n'); if(nl != NULL) *nl = '\0'; if(strcmp(buff, "#quit#") == 0) { diff --git a/phoned/modem.c b/phoned/modem.c index 34dae99..e8cf380 100644 --- a/phoned/modem.c +++ b/phoned/modem.c @@ -122,7 +122,7 @@ char *sendwr(str, bufferback, howmuch) write(modemfd, str, strlen(str) + 1); write(modemfd, "\r\n", 3); fds[0].fd = modemfd; - fds[0].events = POLLRDNORM; + fds[0].events = POLLRDNORM | POLLIN; switch(poll(fds, 1, 3000)) { case 0: pthread_cond_signal(&mpcond); diff --git a/phoned/modems/rockwell.c b/phoned/modems/rockwell.c index 7f8d14c..6503ee0 100644 --- a/phoned/modems/rockwell.c +++ b/phoned/modems/rockwell.c @@ -27,7 +27,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ -/* $Amigan: phoned/phoned/modems/rockwell.c,v 1.9 2005/06/28 02:00:08 dcp1990 Exp $ */ +/* $Amigan: phoned/phoned/modems/rockwell.c,v 1.10 2005/06/29 22:02:27 dcp1990 Exp $ */ #include #include #include @@ -48,6 +48,8 @@ int rw_init(void) { stmod(ROCKWELL_INITSTRING); stmod("AT#CID=2"); + stmod("ATE0"); + stmod("ATV0"); return 1; } int rw_destroy(void)