diff options
Diffstat (limited to 'winsup/cygwin/fhandler_clipboard.cc')
-rw-r--r-- | winsup/cygwin/fhandler_clipboard.cc | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/winsup/cygwin/fhandler_clipboard.cc b/winsup/cygwin/fhandler_clipboard.cc index 6a22855aa..ce14def20 100644 --- a/winsup/cygwin/fhandler_clipboard.cc +++ b/winsup/cygwin/fhandler_clipboard.cc @@ -1,6 +1,6 @@ /* fhandler_dev_clipboard: code to access /dev/clipboard - Copyright 2000, 2001 Red Hat, Inc + Copyright 2000, 2001, 2002 Red Hat, Inc Written by Charles Wilson (cwilson@ece.gatech.edu) @@ -32,14 +32,10 @@ static const NO_COPY char *CYGWIN_NATIVE = "CYGWIN_NATIVE_CLIPBOARD"; /* this is MT safe because windows format id's are atomic */ static UINT cygnativeformat; -fhandler_dev_clipboard::fhandler_dev_clipboard (const char *name): -fhandler_base (FH_CLIPBOARD, name) +fhandler_dev_clipboard::fhandler_dev_clipboard () + : fhandler_base (FH_CLIPBOARD), pos (0), membuffer (NULL), msize (0), + eof (true) { - set_cb (sizeof *this); - eof = true; - pos = 0; - membuffer = NULL; - msize = 0; /* FIXME: check for errors and loop until we can open the clipboard */ OpenClipboard (NULL); cygnativeformat = RegisterClipboardFormat (CYGWIN_NATIVE); @@ -56,7 +52,7 @@ fhandler_dev_clipboard::dup (fhandler_base * child) { fhandler_dev_clipboard *fhc = (fhandler_dev_clipboard *) child; - if (!fhc->open (get_name (), get_flags (), 0)) + if (!fhc->open (NULL, get_flags (), 0)) system_printf ("error opening clipboard, %E"); fhc->membuffer = membuffer; @@ -67,9 +63,9 @@ fhandler_dev_clipboard::dup (fhandler_base * child) } int -fhandler_dev_clipboard::open (const char *, int flags, mode_t) +fhandler_dev_clipboard::open (path_conv *, int flags, mode_t) { - set_flags (flags); + set_flags (flags | O_TEXT); eof = false; pos = 0; if (membuffer) @@ -77,6 +73,7 @@ fhandler_dev_clipboard::open (const char *, int flags, mode_t) membuffer = NULL; if (!cygnativeformat) cygnativeformat = RegisterClipboardFormat (CYGWIN_NATIVE); + set_nohandle (true); set_open_status (); return 1; } @@ -188,7 +185,7 @@ fhandler_dev_clipboard::write (const void *buf, size_t len) } } -int +int __stdcall fhandler_dev_clipboard::read (void *ptr, size_t len) { HGLOBAL hglb; @@ -250,8 +247,8 @@ fhandler_dev_clipboard::read (void *ptr, size_t len) } } -off_t -fhandler_dev_clipboard::lseek (off_t offset, int whence) +__off64_t +fhandler_dev_clipboard::lseek (__off64_t offset, int whence) { /* On reads we check this at read time, not seek time. * On writes we use this to decide how to write - empty and write, or open, copy, empty |