/*
- $Id: socket.c,v 1.6 2010-01-05 19:05:52 franklahm Exp $
Copyright (c) 2009 Frank Lahm <franklahm@gmail.com>
This program is free software; you can redistribute it and/or modify
goto exit;
}
if (now.tv_usec > end.tv_usec) {
- tv.tv_usec = 1000 + end.tv_usec - now.tv_usec;
+ tv.tv_usec = 1000000 + end.tv_usec - now.tv_usec;
tv.tv_sec = end.tv_sec - now.tv_sec - 1;
} else {
tv.tv_usec = end.tv_usec - now.tv_usec;
return -1;
}
+ if (len == -1 && stored == 0)
+ /* last read or select got an error and we haven't got yet anything => return -1*/
+ return -1;
return stored;
}