diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2023-08-09 17:56:02 +0300 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2023-08-09 17:56:02 +0300 |
commit | 5b53633b5dd02adf7b2b00ac0b69906e4ea3ffe6 (patch) | |
tree | 1618999e59289cac83ec4a2af5e61f6ff21c7ddf /winsup | |
parent | 07092a52e9516f0c341f7f3e5e6169c1e33b6fcc (diff) |
Cygwin: clipboard: Only SEEK_SET and SEEK_CUR are supported
Make sure of that, especially given the addition of
SEEK_DATA and SEEK_HOLE.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Diffstat (limited to 'winsup')
-rw-r--r-- | winsup/cygwin/fhandler/clipboard.cc | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/winsup/cygwin/fhandler/clipboard.cc b/winsup/cygwin/fhandler/clipboard.cc index fe3545bf5..376d43440 100644 --- a/winsup/cygwin/fhandler/clipboard.cc +++ b/winsup/cygwin/fhandler/clipboard.cc @@ -322,6 +322,13 @@ fhandler_dev_clipboard::lseek (off_t offset, int whence) * On writes we use this to decide how to write - empty and write, or open, copy, empty * and write */ + if (whence == SEEK_CUR) + return 0; + if (whence != SEEK_SET) + { + set_errno (EINVAL); + return -1; + } pos = offset; /* treat seek like rewind */ if (membuffer) |