projects
/
samtools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Imported Upstream version 0.1.11
[samtools.git]
/
knetfile.c
diff --git
a/knetfile.c
b/knetfile.c
index 994babb6a384e2757098bd6b042970a4dd54a801..1e2c042701de0fec88212f563ff4862da6fcad93 100644
(file)
--- a/
knetfile.c
+++ b/
knetfile.c
@@
-38,9
+38,7
@@
#include <unistd.h>
#include <sys/types.h>
#include <unistd.h>
#include <sys/types.h>
-#ifdef _WIN32
-#include <winsock.h>
-#else
+#ifndef _WIN32
#include <netdb.h>
#include <arpa/inet.h>
#include <sys/socket.h>
#include <netdb.h>
#include <arpa/inet.h>
#include <sys/socket.h>
@@
-519,7
+517,10
@@
off_t knet_read(knetFile *fp, void *buf, off_t len)
if (fp->type == KNF_TYPE_LOCAL) { // on Windows, the following block is necessary; not on UNIX
off_t rest = len, curr;
while (rest) {
if (fp->type == KNF_TYPE_LOCAL) { // on Windows, the following block is necessary; not on UNIX
off_t rest = len, curr;
while (rest) {
- curr = read(fp->fd, buf + l, rest);
+ do {
+ curr = read(fp->fd, buf + l, rest);
+ } while (curr < 0 && EINTR == errno);
+ if (curr < 0) return -1;
if (curr == 0) break;
l += curr; rest -= curr;
}
if (curr == 0) break;
l += curr; rest -= curr;
}
@@
-566,7
+567,7
@@
off_t knet_seek(knetFile *fp, int64_t off, int whence)
else if (whence==SEEK_SET)
fp->offset = off;
fp->is_ready = 0;
else if (whence==SEEK_SET)
fp->offset = off;
fp->is_ready = 0;
- return
fp->offset
;
+ return
0
;
}
errno = EINVAL;
fprintf(stderr,"[knet_seek] %s\n", strerror(errno));
}
errno = EINVAL;
fprintf(stderr,"[knet_seek] %s\n", strerror(errno));