diff options
| -rw-r--r-- | gpgme/ChangeLog | 7 | ||||
| -rw-r--r-- | gpgme/posix-io.c | 55 | ||||
| -rw-r--r-- | gpgme/priv-io.h | 2 | ||||
| -rw-r--r-- | gpgme/w32-io.c | 54 | 
4 files changed, 31 insertions, 87 deletions
diff --git a/gpgme/ChangeLog b/gpgme/ChangeLog index b7fb4e45..0f2c67ba 100644 --- a/gpgme/ChangeLog +++ b/gpgme/ChangeLog @@ -1,3 +1,10 @@ +2005-11-17  Marcus Brinkmann  <[email protected]> + +	* priv-io.h (_gpgme_io_waitpid, _gpgme_io_kill): Removed. +	* w32-io.c (_gpgme_io_waitpid, _gpgme_io_kill): Removed. +	* posix-io.c (_gpgme_io_kill): Removed. +	(_gpgme_io_waitpid): Declare static. +  2005-10-24  Marcus Brinkmann  <[email protected]>  	* w32-io.c (_gpgme_io_spawn): Don't minimize window, hide it. diff --git a/gpgme/posix-io.c b/gpgme/posix-io.c index d4289846..3479483e 100644 --- a/gpgme/posix-io.c +++ b/gpgme/posix-io.c @@ -174,6 +174,30 @@ _gpgme_io_set_nonblocking (int fd)  } +static int +_gpgme_io_waitpid (int pid, int hang, int *r_status, int *r_signal) +{ +  int status; + +  *r_status = 0; +  *r_signal = 0; +  if (_gpgme_ath_waitpid (pid, &status, hang? 0 : WNOHANG) == pid) +    { +      if (WIFSIGNALED (status)) +	{ +	  *r_status = 4; /* Need some value here.  */ +	  *r_signal = WTERMSIG (status); +	} +      else if (WIFEXITED (status)) +	*r_status = WEXITSTATUS (status); +      else +	*r_status = 4; /* Oops.  */ +      return 1; +    } +  return 0; +} + +  /* Returns 0 on success, -1 on error.  */  int  _gpgme_io_spawn (const char *path, char **argv, @@ -273,37 +297,6 @@ _gpgme_io_spawn (const char *path, char **argv,  } -int -_gpgme_io_waitpid (int pid, int hang, int *r_status, int *r_signal) -{ -  int status; - -  *r_status = 0; -  *r_signal = 0; -  if (_gpgme_ath_waitpid (pid, &status, hang? 0 : WNOHANG) == pid) -    { -      if (WIFSIGNALED (status)) -	{ -	  *r_status = 4; /* Need some value here.  */ -	  *r_signal = WTERMSIG (status); -	} -      else if (WIFEXITED (status)) -	*r_status = WEXITSTATUS (status); -      else -	*r_status = 4; /* Oops.  */ -      return 1; -    } -  return 0; -} - - -int -_gpgme_io_kill (int pid, int hard) -{ -  return kill (pid, hard ? SIGKILL : SIGTERM); -} - -  /*   * Select on the list of fds.   * Returns: -1 = error diff --git a/gpgme/priv-io.h b/gpgme/priv-io.h index 3a7150c3..786f2432 100644 --- a/gpgme/priv-io.h +++ b/gpgme/priv-io.h @@ -57,8 +57,6 @@ int _gpgme_io_set_nonblocking (int fd);  int _gpgme_io_spawn (const char *path, char **argv,  		     struct spawn_fd_item_s *fd_child_list,  		     struct spawn_fd_item_s *fd_parent_list); -int _gpgme_io_waitpid (int pid, int hang, int *r_status, int *r_signal); -int _gpgme_io_kill (int pid, int hard);  int _gpgme_io_select (struct io_select_fd_s *fds, size_t nfds, int nonblock);  #endif /* IO_H */ diff --git a/gpgme/w32-io.c b/gpgme/w32-io.c index 826347a1..7ad10ecb 100644 --- a/gpgme/w32-io.c +++ b/gpgme/w32-io.c @@ -942,60 +942,6 @@ _gpgme_io_spawn ( const char *path, char **argv,  } - - -int -_gpgme_io_waitpid ( int pid, int hang, int *r_status, int *r_signal ) -{ -    HANDLE proc = fd_to_handle (pid); -    int code, ret = 0; -    DWORD exc; - -    *r_status = 0; -    *r_signal = 0; -    code = WaitForSingleObject ( proc, hang? INFINITE : 0 ); -    switch (code) { -      case WAIT_FAILED: -        DEBUG2 ("WFSO pid=%d failed: %d\n", (int)pid, (int)GetLastError () ); -        break; - -      case WAIT_OBJECT_0: -        if (!GetExitCodeProcess (proc, &exc)) { -            DEBUG2 ("** GECP pid=%d failed: ec=%d\n", -                    (int)pid, (int)GetLastError () ); -            *r_status = 4;  -        } -        else { -            DEBUG2 ("GECP pid=%d exit code=%d\n", (int)pid,  exc); -            *r_status = exc; -        } -        ret = 1; -        break; - -      case WAIT_TIMEOUT: -        if (hang) -            DEBUG1 ("WFSO pid=%d timed out\n", (int)pid); -        break; - -      default: -        DEBUG2 ("WFSO pid=%d returned %d\n", (int)pid, code ); -        break; -    } -    return ret; -} - -int -_gpgme_io_kill ( int pid, int hard ) -{ -    HANDLE proc = fd_to_handle (pid); - -    #warning I am not sure how to kill a process -    /* fixme: figure out how this can be done */ -    return 0; -} - - -  /*   * Select on the list of fds.   * Returns: -1 = error  | 
