projects
/
svn42.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
87c494c
)
timespec
author
Bernhard Tittelbach
<xro@realraum.at>
Sat, 24 Apr 2010 02:29:06 +0000
(
02:29
+0000)
committer
Bernhard Tittelbach
<xro@realraum.at>
Sat, 24 Apr 2010 02:29:06 +0000
(
02:29
+0000)
serial_console/sample_sensors.c
patch
|
blob
|
history
diff --git
a/serial_console/sample_sensors.c
b/serial_console/sample_sensors.c
index
03b241d
..
01f4e88
100644
(file)
--- a/
serial_console/sample_sensors.c
+++ b/
serial_console/sample_sensors.c
@@
-48,7
+48,7
@@
void sample_sensors(int fd)
{
if (fd < 3)
return;
- struct timespec timeout;
+ struct timeval timeout;
fd_set fds_r;
unsigned int const buffer_size=1024;
unsigned int buffer_offset=0;
@@
-64,9
+64,9
@@
void sample_sensors(int fd)
FD_ZERO(&fds_r);
FD_SET(fd,&fds_r);
timeout.tv_sec=1;
- timeout.tv_nsec=0;
+ timeout.tv_usec=0;
last_sample_time=time(0);
- while (select(fd+1,&fds_r,0,0,0) > 0)
+ while (select(fd+1,&fds_r,0,0,timeout) > -1)
{
curr_time=time(0);
if (FD_ISSET(fd,&fds_r))
@@
-122,7
+122,7
@@
void sample_sensors(int fd)
FD_SET(fd,&fds_r);
timeout.tv_sec=1;
- timeout.tv_nsec=0;
+ timeout.tv_usec=0;
}
}