]> git.donarmstrong.com Git - samtools.git/blobdiff - knetfile.c
added revised MAQ error model
[samtools.git] / knetfile.c
index da992ede02016e153fca2b824813eb34c3b9880c..e1be4d669b845babe504dc1bfd2e2ccbe806f593 100644 (file)
@@ -38,9 +38,7 @@
 #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>
@@ -536,7 +534,8 @@ off_t knet_seek(knetFile *fp, int64_t off, int whence)
                 * while fseek() returns zero on success. */
                off_t offset = lseek(fp->fd, off, whence);
                if (offset == -1) {
-            fprintf(stderr,"[knet_seek] %s\n", strerror(errno));
+            // Be silent, it is OK for knet_seek to fail when the file is streamed
+            // fprintf(stderr,"[knet_seek] %s\n", strerror(errno));
                        return -1;
                }
                fp->offset = offset;
@@ -565,7 +564,7 @@ off_t knet_seek(knetFile *fp, int64_t off, int whence)
         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));