* fhandler.h (class fhandler_dev_mem): Remove dup method declaration.
* fhandler_clipboard.cc (fhandler_dev_clipboard::dup): Accommodate the fact that the entire fhandler gets copied over to the child in operator =. * fhandler_floppy.cc (fhandler_dev_floppy::dup): Ditto. * fhandler_raw.cc (fhandler_dev_raw::dup): Ditto. * fhandler_serial.cc (fhandler_serial::dup): Ditto. * fhandler_socket.cc (fhandler_socket::dup): Ditto. * fhandler_virtual.cc (fhandler_virtual::dup): Ditto. * fhandler_mem.cc (fhandler_dev_mem::dup): Ditto. Remove entirely.
This commit is contained in:
		| @@ -1,3 +1,16 @@ | |||||||
|  | 2011-07-31  Corinna Vinschen  <corinna@vinschen.de> | ||||||
|  |  | ||||||
|  | 	* fhandler.h (class fhandler_dev_mem): Remove dup method declaration. | ||||||
|  | 	* fhandler_clipboard.cc (fhandler_dev_clipboard::dup): Accommodate the | ||||||
|  | 	fact that the entire fhandler gets copied over to the child in | ||||||
|  | 	operator =. | ||||||
|  | 	* fhandler_floppy.cc (fhandler_dev_floppy::dup): Ditto. | ||||||
|  | 	* fhandler_raw.cc (fhandler_dev_raw::dup): Ditto. | ||||||
|  | 	* fhandler_serial.cc (fhandler_serial::dup): Ditto. | ||||||
|  | 	* fhandler_socket.cc (fhandler_socket::dup): Ditto. | ||||||
|  | 	* fhandler_virtual.cc (fhandler_virtual::dup): Ditto. | ||||||
|  | 	* fhandler_mem.cc (fhandler_dev_mem::dup): Ditto.  Remove entirely. | ||||||
|  |  | ||||||
| 2011-07-30  Christopher Faylor  <me.cygwin2011@cgf.cx> | 2011-07-30  Christopher Faylor  <me.cygwin2011@cgf.cx> | ||||||
|  |  | ||||||
| 	* cygthread.cc (cygthread::async_create): Define new function. | 	* cygthread.cc (cygthread::async_create): Define new function. | ||||||
|   | |||||||
| @@ -1317,7 +1317,6 @@ class fhandler_dev_mem: public fhandler_base | |||||||
|   void __stdcall read (void *ptr, size_t& len) __attribute__ ((regparm (3))); |   void __stdcall read (void *ptr, size_t& len) __attribute__ ((regparm (3))); | ||||||
|   _off64_t lseek (_off64_t offset, int whence); |   _off64_t lseek (_off64_t offset, int whence); | ||||||
|   int __stdcall fstat (struct __stat64 *buf) __attribute__ ((regparm (2))); |   int __stdcall fstat (struct __stat64 *buf) __attribute__ ((regparm (2))); | ||||||
|   int dup (fhandler_base *child); |  | ||||||
|  |  | ||||||
|   HANDLE mmap (caddr_t *addr, size_t len, int prot, int flags, _off64_t off); |   HANDLE mmap (caddr_t *addr, size_t len, int prot, int flags, _off64_t off); | ||||||
|   int munmap (HANDLE h, caddr_t addr, size_t len); |   int munmap (HANDLE h, caddr_t addr, size_t len); | ||||||
|   | |||||||
| @@ -50,11 +50,6 @@ fhandler_dev_clipboard::dup (fhandler_base * child) | |||||||
|  |  | ||||||
|   if (!fhc->open (get_flags (), 0)) |   if (!fhc->open (get_flags (), 0)) | ||||||
|     system_printf ("error opening clipboard, %E"); |     system_printf ("error opening clipboard, %E"); | ||||||
|  |  | ||||||
|   fhc->membuffer = membuffer; |  | ||||||
|   fhc->pos = pos; |  | ||||||
|   fhc->msize = msize; |  | ||||||
|  |  | ||||||
|   return 0; |   return 0; | ||||||
| } | } | ||||||
|  |  | ||||||
|   | |||||||
| @@ -407,21 +407,10 @@ fhandler_dev_floppy::close () | |||||||
| int | int | ||||||
| fhandler_dev_floppy::dup (fhandler_base *child) | fhandler_dev_floppy::dup (fhandler_base *child) | ||||||
| { | { | ||||||
|   fhandler_dev_floppy *fhc = (fhandler_dev_floppy *) child; |  | ||||||
|  |  | ||||||
|   int ret = fhandler_dev_raw::dup (child); |   int ret = fhandler_dev_raw::dup (child); | ||||||
|  |  | ||||||
|   if (!ret) |   if (!ret && partitions) | ||||||
|     { |     InterlockedIncrement (&partitions->refcnt); | ||||||
|       fhc->drive_size = drive_size; |  | ||||||
|       fhc->bytes_per_sector = bytes_per_sector; |  | ||||||
|       if (partitions) |  | ||||||
| 	{ |  | ||||||
| 	  InterlockedIncrement (&partitions->refcnt); |  | ||||||
| 	  fhc->partitions = partitions; |  | ||||||
| 	} |  | ||||||
|       fhc->eom_detected (eom_detected ()); |  | ||||||
|     } |  | ||||||
|   return ret; |   return ret; | ||||||
| } | } | ||||||
|  |  | ||||||
|   | |||||||
| @@ -263,18 +263,3 @@ fhandler_dev_mem::fstat (struct __stat64 *buf) | |||||||
|  |  | ||||||
|   return 0; |   return 0; | ||||||
| } | } | ||||||
|  |  | ||||||
| int |  | ||||||
| fhandler_dev_mem::dup (fhandler_base *child) |  | ||||||
| { |  | ||||||
|   int ret = fhandler_base::dup (child); |  | ||||||
|  |  | ||||||
|   if (! ret) |  | ||||||
|     { |  | ||||||
|       fhandler_dev_mem *fhc = (fhandler_dev_mem *) child; |  | ||||||
|  |  | ||||||
|       fhc->mem_size = mem_size; |  | ||||||
|       fhc->pos = pos; |  | ||||||
|     } |  | ||||||
|   return ret; |  | ||||||
| } |  | ||||||
|   | |||||||
| @@ -89,7 +89,6 @@ fhandler_dev_raw::dup (fhandler_base *child) | |||||||
|     { |     { | ||||||
|       fhandler_dev_raw *fhc = (fhandler_dev_raw *) child; |       fhandler_dev_raw *fhc = (fhandler_dev_raw *) child; | ||||||
|  |  | ||||||
|       fhc->devbufsiz = devbufsiz; |  | ||||||
|       if (devbufsiz > 1L) |       if (devbufsiz > 1L) | ||||||
| 	fhc->devbuf = new char [devbufsiz]; | 	fhc->devbuf = new char [devbufsiz]; | ||||||
|       fhc->devbufstart = 0; |       fhc->devbufstart = 0; | ||||||
|   | |||||||
| @@ -1176,7 +1176,5 @@ fhandler_serial::dup (fhandler_base *child) | |||||||
| { | { | ||||||
|   fhandler_serial *fhc = (fhandler_serial *) child; |   fhandler_serial *fhc = (fhandler_serial *) child; | ||||||
|   fhc->overlapped_setup (); |   fhc->overlapped_setup (); | ||||||
|   fhc->vmin_ = vmin_; |  | ||||||
|   fhc->vtime_ = vtime_; |  | ||||||
|   return fhandler_base::dup (child); |   return fhandler_base::dup (child); | ||||||
| } | } | ||||||
|   | |||||||
| @@ -770,28 +770,11 @@ fhandler_socket::dup (fhandler_base *child) | |||||||
|       NtClose (fhs->wsock_mtx); |       NtClose (fhs->wsock_mtx); | ||||||
|       return -1; |       return -1; | ||||||
|     } |     } | ||||||
|   fhs->wsock_events = wsock_events; |  | ||||||
|  |  | ||||||
|   fhs->rmem (rmem ()); |  | ||||||
|   fhs->wmem (wmem ()); |  | ||||||
|   fhs->addr_family = addr_family; |  | ||||||
|   fhs->set_socket_type (get_socket_type ()); |  | ||||||
|   if (get_addr_family () == AF_LOCAL) |   if (get_addr_family () == AF_LOCAL) | ||||||
|     { |     { | ||||||
|       fhs->set_sun_path (get_sun_path ()); |       fhs->set_sun_path (get_sun_path ()); | ||||||
|       fhs->set_peer_sun_path (get_peer_sun_path ()); |       fhs->set_peer_sun_path (get_peer_sun_path ()); | ||||||
|       if (get_socket_type () == SOCK_STREAM) |  | ||||||
| 	{ |  | ||||||
| 	  fhs->sec_pid = sec_pid; |  | ||||||
| 	  fhs->sec_uid = sec_uid; |  | ||||||
| 	  fhs->sec_gid = sec_gid; |  | ||||||
| 	  fhs->sec_peer_pid = sec_peer_pid; |  | ||||||
| 	  fhs->sec_peer_uid = sec_peer_uid; |  | ||||||
| 	  fhs->sec_peer_gid = sec_peer_gid; |  | ||||||
| 	} |  | ||||||
|     } |     } | ||||||
|   fhs->connect_state (connect_state ()); |  | ||||||
|  |  | ||||||
|   if (!need_fixup_before ()) |   if (!need_fixup_before ()) | ||||||
|     { |     { | ||||||
|       int ret = fhandler_base::dup (child); |       int ret = fhandler_base::dup (child); | ||||||
| @@ -806,14 +789,14 @@ fhandler_socket::dup (fhandler_base *child) | |||||||
|   cygheap->user.deimpersonate (); |   cygheap->user.deimpersonate (); | ||||||
|   fhs->init_fixup_before (); |   fhs->init_fixup_before (); | ||||||
|   fhs->set_io_handle (get_io_handle ()); |   fhs->set_io_handle (get_io_handle ()); | ||||||
|   if (!fhs->fixup_before_fork_exec (GetCurrentProcessId ())) |   int ret = fhs->fixup_before_fork_exec (GetCurrentProcessId ()); | ||||||
|  |   cygheap->user.reimpersonate (); | ||||||
|  |   if (!ret) | ||||||
|     { |     { | ||||||
|       cygheap->user.reimpersonate (); |  | ||||||
|       fhs->fixup_after_fork (GetCurrentProcess ()); |       fhs->fixup_after_fork (GetCurrentProcess ()); | ||||||
|       if (fhs->get_io_handle() != (HANDLE) INVALID_SOCKET) |       if (fhs->get_io_handle() != (HANDLE) INVALID_SOCKET) | ||||||
| 	return 0; | 	return 0; | ||||||
|     } |     } | ||||||
|   cygheap->user.reimpersonate (); |  | ||||||
|   cygheap->fdtab.dec_need_fixup_before (); |   cygheap->fdtab.dec_need_fixup_before (); | ||||||
|   NtClose (fhs->wsock_evt); |   NtClose (fhs->wsock_evt); | ||||||
|   NtClose (fhs->wsock_mtx); |   NtClose (fhs->wsock_mtx); | ||||||
|   | |||||||
| @@ -160,10 +160,7 @@ fhandler_virtual::dup (fhandler_base * child) | |||||||
|     { |     { | ||||||
|       fhandler_virtual *fhproc_child = (fhandler_virtual *) child; |       fhandler_virtual *fhproc_child = (fhandler_virtual *) child; | ||||||
|       fhproc_child->filebuf = (char *) cmalloc_abort (HEAP_BUF, filesize); |       fhproc_child->filebuf = (char *) cmalloc_abort (HEAP_BUF, filesize); | ||||||
|       fhproc_child->filesize = filesize; |  | ||||||
|       fhproc_child->position = position; |  | ||||||
|       memcpy (fhproc_child->filebuf, filebuf, filesize); |       memcpy (fhproc_child->filebuf, filebuf, filesize); | ||||||
|       fhproc_child->set_flags (get_flags ()); |  | ||||||
|     } |     } | ||||||
|   return ret; |   return ret; | ||||||
| } | } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user