diff options
| author | Werner Koch <[email protected]> | 2013-02-06 16:35:40 +0000 | 
|---|---|---|
| committer | Werner Koch <[email protected]> | 2013-02-06 16:35:40 +0000 | 
| commit | 51fd6d8292cb41d743407e6ac9d86a5ab8e68d8c (patch) | |
| tree | d431a193f5eece63dba5aa6485416e79f67396cb /src/wait.c | |
| parent | Improve parsing of the GIT revision number. (diff) | |
| download | gpgme-51fd6d8292cb41d743407e6ac9d86a5ab8e68d8c.tar.gz gpgme-51fd6d8292cb41d743407e6ac9d86a5ab8e68d8c.zip  | |
Use gpg_error_from_syserror instead of directly accessing errno.
--
Also fixed a couple of minor thing; e.g. save the error before calling
cleanup functions.  Do not save the errno if only free is called
in between.
Diffstat (limited to 'src/wait.c')
| -rw-r--r-- | src/wait.c | 7 | 
1 files changed, 3 insertions, 4 deletions
@@ -73,7 +73,7 @@ fd_table_put (fd_table_t fdt, int fd, int dir, void *opaque, int *idx)        new_fds = realloc (fdt->fds, (fdt->size + FDT_ALLOCSIZE)  			 * sizeof (*new_fds));        if (!new_fds) -	return gpg_error_from_errno (errno); +	return gpg_error_from_syserror ();        fdt->fds = new_fds;        fdt->size += FDT_ALLOCSIZE; @@ -113,16 +113,15 @@ _gpgme_add_io_cb (void *data, int fd, int dir, gpgme_io_cb_t fnc,    tag = malloc (sizeof *tag);    if (!tag) -    return gpg_error_from_errno (errno); +    return gpg_error_from_syserror ();    tag->ctx = ctx;    /* Allocate a structure to hold information about the handler.  */    item = calloc (1, sizeof *item);    if (!item)      { -      int saved_errno = errno;        free (tag); -      return gpg_error_from_errno (saved_errno); +      return gpg_error_from_syserror ();      }    item->ctx = ctx;    item->dir = dir;  | 
