X-Git-Url: http://nsz.repo.hu/git/?p=musl;a=blobdiff_plain;f=src%2Fstdio%2F__stdio_seek.c;h=35ae788cd1aface51136b4d53ffa6e493e98a37d;hp=c205ab8206a36341fada87615b0af7706ed26dfd;hb=e3cd6c5c265cd481db6e0c5b529855d99f0bda30;hpb=ea343364a719add2cd8adf8a50c15bb5f9400dd8 diff --git a/src/stdio/__stdio_seek.c b/src/stdio/__stdio_seek.c index c205ab82..35ae788c 100644 --- a/src/stdio/__stdio_seek.c +++ b/src/stdio/__stdio_seek.c @@ -2,6 +2,7 @@ static off_t retneg1(FILE *f, off_t off, int whence) { + errno = ESPIPE; return -1; } @@ -15,7 +16,6 @@ off_t __stdio_seek(FILE *f, off_t off, int whence) ret = syscall(SYS_lseek, f->fd, off, whence); #endif /* Detect unseekable files and optimize future failures out */ - if (ret < 0 && off == 0 && whence == SEEK_CUR) - f->seek = retneg1; + if (ret < 0 && errno == ESPIPE) f->seek = retneg1; return ret; }