Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'winsup/cygwin/syscalls.cc')
-rw-r--r--winsup/cygwin/syscalls.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/winsup/cygwin/syscalls.cc b/winsup/cygwin/syscalls.cc
index 99e3de7ec..d5bb510ee 100644
--- a/winsup/cygwin/syscalls.cc
+++ b/winsup/cygwin/syscalls.cc
@@ -447,7 +447,12 @@ _lseek (int fd, off_t pos, int dir)
off_t res;
sigframe thisframe (mainthread);
- if (fdtab.not_open (fd))
+ if ( dir != SEEK_SET && dir != SEEK_CUR && dir != SEEK_END )
+ {
+ set_errno ( EINVAL );
+ res = -1;
+ }
+ else if (fdtab.not_open (fd))
{
set_errno (EBADF);
res = -1;