Commit 9f58154d authored by Matteo Quintiliani's avatar Matteo Quintiliani

Fixed bug in nmxp_recv_select_timeout() when program receives a signal


git-svn-id: file:///home/quintiliani/svncopy/nmxptool/trunk@990 3cd66e75-5955-46cb-a940-c26e5fc5497d
parent 283e466d
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* Istituto Nazionale di Geofisica e Vulcanologia - Italy * Istituto Nazionale di Geofisica e Vulcanologia - Italy
* quintiliani@ingv.it * quintiliani@ingv.it
* *
* $Id: nmxp_base.c,v 1.68 2008-03-30 06:07:47 mtheo Exp $ * $Id: nmxp_base.c,v 1.69 2008-03-31 05:09:33 mtheo Exp $
* *
*/ */
...@@ -163,6 +163,7 @@ int nmxp_recv_select_timeout(int s, char *buf, int len, int timeout) ...@@ -163,6 +163,7 @@ int nmxp_recv_select_timeout(int s, char *buf, int len, int timeout)
/* wait until timeout or data received*/ /* wait until timeout or data received*/
n = select(s+1, &fds, NULL, NULL, &tv); n = select(s+1, &fds, NULL, NULL, &tv);
if (n == 0) return -2; /* timeout!*/ if (n == 0) return -2; /* timeout!*/
if(errno == EINTR) return -2; /* timeout! "Interrupted system call" */
if (n == -1) return -1; /* error*/ if (n == -1) return -1; /* error*/
/* data must be here, so do a normal recv()*/ /* data must be here, so do a normal recv()*/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment