aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2011-10-09 16:10:32 +0200
committerHolger Hans Peter Freyther <zecke@selfish.org>2011-10-09 16:10:32 +0200
commite5c0adc53e6f5e34857e42e42b5cf5e606430857 (patch)
treea3a4605066f4328afd4f3cbb97a20306b0aadbb3
parent861a0b11aaf3d7a2c1ef8577c592bfc02e59dcbd (diff)
posix: Remove the io_read_response implementation as it is unused
-rw-r--r--io.h1
-rw-r--r--io_posix.c49
2 files changed, 0 insertions, 50 deletions
diff --git a/io.h b/io.h
index 703f796..cb45dab 100644
--- a/io.h
+++ b/io.h
@@ -24,7 +24,6 @@ int io_init( char *dev );
int io_cleanup( void );
int io_write( void *buff, int len );
int io_read( void *buff, int len );
-int io_read_response( char *buff, int len );
static inline int io_send_cmd( char *cmd, void *response, int response_len )
diff --git a/io_posix.c b/io_posix.c
index ae98e10..e7e80ad 100644
--- a/io_posix.c
+++ b/io_posix.c
@@ -98,52 +98,3 @@ int io_read( void *buff, int len )
#endif
}
-#if 0
-int io_read_response( char *buff, int len )
-{
- int read_len = 0;
- struct timeval tv;
- fd_set fds;
- int ret;
-
- while( read_len < len ) {
-
- tv.tv_sec = 1;
- tv.tv_usec = 0;
-
- FD_ZERO( &fds );
- FD_SET( io_fd, &fds );
-
- if( (ret = select( io_fd + 1, &fds, NULL, NULL, &tv )) < 0 ) {
- if( errno == EINTR ) {
- continue;
- }
- }
- if( ret == 0 ) {
- buff[read_len] = '\0';
- printf( "timeout '%s'\n", buff);
- return -read_len;
- }
-
- if( (ret = read( io_fd, buff + read_len, len - read_len )) < 0 ) {
- return -1;
- }
- read_len += ret;
-
- if( (read_len > 0) &&
- buff[ read_len - 1 ] == '>' ) {
- if( (read_len > 2) &&
- buff[ read_len - 2 ] == '\r' &&
- buff[ read_len - 3 ] == '\n' ) {
- return buff[read_len - 3] = '\0' ;
- return read_len-3 ;
- } else {
- return buff[read_len - 1] = '\0' ;
- return read_len-1 ;
- }
- }
- }
-
- return read_len;
-}
-#endif