diff options
author | Suren A. Chilingaryan <csa@dside.dyndns.org> | 2005-08-03 01:48:35 +0000 |
---|---|---|
committer | Suren A. Chilingaryan <csa@dside.dyndns.org> | 2005-08-03 01:48:35 +0000 |
commit | dcd966ba50fa18853c5ae06125a5b08b0ee6b10d (patch) | |
tree | 8147928dbe65fc6b4d83e5cc15d1b3ac5993e0eb /src/rccexternal.c | |
parent | 8b75f9bb6a09d54d634ff661655659951378aa2c (diff) | |
download | librcc-dcd966ba50fa18853c5ae06125a5b08b0ee6b10d.tar.gz librcc-dcd966ba50fa18853c5ae06125a5b08b0ee6b10d.tar.bz2 librcc-dcd966ba50fa18853c5ae06125a5b08b0ee6b10d.tar.xz librcc-dcd966ba50fa18853c5ae06125a5b08b0ee6b10d.zip |
Language Fixes and Improvements
- rccmutex
- Language autodetection fixes and improvements
- Language translation fixes and improvements
- The current state is near to be usable
Diffstat (limited to 'src/rccexternal.c')
-rw-r--r-- | src/rccexternal.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/rccexternal.c b/src/rccexternal.c index 4a09948..6a81c56 100644 --- a/src/rccexternal.c +++ b/src/rccexternal.c @@ -42,6 +42,7 @@ #include "internal.h" #define RCC_EXT_PROG_NAME "rccexternal" +#define RCC_EXTERNAL_TIMEOUT 250 /* 100us */ static pid_t pid = (pid_t)-1; static char *addr = NULL; @@ -88,9 +89,13 @@ void rccExternalFree() { } static int rccExternalSetDeadline(struct timeval *tv, unsigned long timeout) { +/* gettimeofday(tv, NULL); tv->tv_sec += (tv->tv_usec + timeout + RCC_EXTERNAL_TIMEOUT) / 1000000; tv->tv_usec = (tv->tv_usec + timeout + RCC_EXTERNAL_TIMEOUT) % 1000000; +*/ + tv->tv_sec = (timeout + RCC_EXTERNAL_TIMEOUT) / 1000000; + tv->tv_usec = (timeout + RCC_EXTERNAL_TIMEOUT) % 1000000; return 0; } @@ -103,7 +108,7 @@ size_t rccExternalWrite(int s, const char *buffer, ssize_t size, unsigned long t if (s == -1) return -1; - for (writed = 0; (writed < size)&&(connected); writed += connected?res:0) { + for (writed = 0; ((writed < size)&&(connected)); writed += connected?res:0) { FD_ZERO(&fdcon); FD_SET(s, &fdcon); rccExternalSetDeadline(&tv, timeout); @@ -127,7 +132,7 @@ size_t rccExternalRead(int s, char *buffer, ssize_t size, unsigned long timeout) if (s == -1) return -1; - for (readed = 0; (readed < size)&&(connected); readed += connected?res:0) { + for (readed = 0; ((readed < size)&&(connected)); readed += connected?res:0) { FD_ZERO(&fdcon); FD_SET(s, &fdcon); rccExternalSetDeadline(&tv, timeout); |