Cygwin: FIFO: remove the arm method
There's no reason to check for errors when we set read_ready or write_ready. We don't do that for other events.
This commit is contained in:
		| @@ -1343,7 +1343,6 @@ public: | |||||||
|   void set_close_on_exec (bool val); |   void set_close_on_exec (bool val); | ||||||
|   void __reg3 raw_read (void *ptr, size_t& ulen); |   void __reg3 raw_read (void *ptr, size_t& ulen); | ||||||
|   ssize_t __reg3 raw_write (const void *ptr, size_t ulen); |   ssize_t __reg3 raw_write (const void *ptr, size_t ulen); | ||||||
|   bool arm (HANDLE h); |  | ||||||
|   bool need_fixup_before () const { return reader; } |   bool need_fixup_before () const { return reader; } | ||||||
|   int fixup_before_fork_exec (DWORD) { stop_listen_client (); return 0; } |   int fixup_before_fork_exec (DWORD) { stop_listen_client (); return 0; } | ||||||
|   void init_fixup_before (); |   void init_fixup_before (); | ||||||
|   | |||||||
| @@ -93,28 +93,6 @@ sec_user_cloexec (bool cloexec, PSECURITY_ATTRIBUTES sa, PSID sid) | |||||||
|   return cloexec ? sec_user_nih (sa, sid) : sec_user (sa, sid); |   return cloexec ? sec_user_nih (sa, sid) : sec_user (sa, sid); | ||||||
| } | } | ||||||
|  |  | ||||||
| bool inline |  | ||||||
| fhandler_fifo::arm (HANDLE h) |  | ||||||
| { |  | ||||||
| #ifdef DEBUGGING |  | ||||||
|   const char *what; |  | ||||||
|   if (h == read_ready) |  | ||||||
|     what = "reader"; |  | ||||||
|   else |  | ||||||
|     what = "writer"; |  | ||||||
|   debug_only_printf ("arming %s", what); |  | ||||||
| #endif |  | ||||||
|  |  | ||||||
|   bool res = SetEvent (h); |  | ||||||
|   if (!res) |  | ||||||
| #ifdef DEBUGGING |  | ||||||
|     debug_printf ("SetEvent for %s failed, %E", what); |  | ||||||
| #else |  | ||||||
|     debug_printf ("SetEvent failed, %E"); |  | ||||||
| #endif |  | ||||||
|   return res; |  | ||||||
| } |  | ||||||
|  |  | ||||||
| static HANDLE | static HANDLE | ||||||
| create_event () | create_event () | ||||||
| { | { | ||||||
| @@ -348,11 +326,7 @@ fhandler_fifo::listen_client_thread () | |||||||
| 	api_fatal ("Can't add a client handler, %E"); | 	api_fatal ("Can't add a client handler, %E"); | ||||||
|  |  | ||||||
|       /* Allow a writer to open. */ |       /* Allow a writer to open. */ | ||||||
|       if (!arm (read_ready)) |       SetEvent (read_ready); | ||||||
| 	{ |  | ||||||
| 	  __seterrno (); |  | ||||||
| 	  goto out; |  | ||||||
| 	} |  | ||||||
|  |  | ||||||
|       /* Listen for a writer to connect to the new client handler. */ |       /* Listen for a writer to connect to the new client handler. */ | ||||||
|       fifo_client_handler& fc = fc_handler[nhandlers - 1]; |       fifo_client_handler& fc = fc_handler[nhandlers - 1]; | ||||||
| @@ -555,9 +529,7 @@ fhandler_fifo::open (int flags, mode_t) | |||||||
| 	  if (NT_SUCCESS (status)) | 	  if (NT_SUCCESS (status)) | ||||||
| 	    { | 	    { | ||||||
| 	      set_pipe_non_blocking (get_handle (), flags & O_NONBLOCK); | 	      set_pipe_non_blocking (get_handle (), flags & O_NONBLOCK); | ||||||
| 	      if (!arm (write_ready)) | 	      SetEvent (write_ready); | ||||||
| 		res = error_set_errno; |  | ||||||
| 	      else |  | ||||||
| 	      res = success; | 	      res = success; | ||||||
| 	      goto out; | 	      goto out; | ||||||
| 	    } | 	    } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user