diff options
author | Marcus Brinkmann <[email protected]> | 2002-09-02 12:17:51 +0000 |
---|---|---|
committer | Marcus Brinkmann <[email protected]> | 2002-09-02 12:17:51 +0000 |
commit | ad264f924bc447d3c93e82e9997fc6cdc2231c48 (patch) | |
tree | 4b86189a10a7aae0ab276250363d829a1e570f61 | |
parent | Bump up version number. (diff) | |
download | gpgme-ad264f924bc447d3c93e82e9997fc6cdc2231c48.tar.gz gpgme-ad264f924bc447d3c93e82e9997fc6cdc2231c48.zip |
2002-09-02 Marcus Brinkmann <[email protected]>
* posix-io.c (_gpgme_io_select): Don't use a non-constant struct initializer.
* version.c (_gpgme_get_program_version): Likewise.
Reported by Dr. Stefan Dalibor <[email protected]>.
-rw-r--r-- | gpgme/ChangeLog | 6 | ||||
-rw-r--r-- | gpgme/posix-io.c | 4 | ||||
-rw-r--r-- | gpgme/version.c | 3 |
3 files changed, 11 insertions, 2 deletions
diff --git a/gpgme/ChangeLog b/gpgme/ChangeLog index abca388b..105a713f 100644 --- a/gpgme/ChangeLog +++ b/gpgme/ChangeLog @@ -1,5 +1,11 @@ 2002-09-02 Marcus Brinkmann <[email protected]> + * posix-io.c (_gpgme_io_select): Don't use a non-constant struct initializer. + * version.c (_gpgme_get_program_version): Likewise. + Reported by Dr. Stefan Dalibor <[email protected]>. + +2002-09-02 Marcus Brinkmann <[email protected]> + * conversion.c (_gpgme_decode_c_string): Set DESTP before modifying DEST. * conversion.c (_gpgme_decode_c_string): Fix off by one error in last change. diff --git a/gpgme/posix-io.c b/gpgme/posix-io.c index d0fd5f8e..da7c106d 100644 --- a/gpgme/posix-io.c +++ b/gpgme/posix-io.c @@ -306,12 +306,14 @@ _gpgme_io_select (struct io_select_fd_s *fds, size_t nfds, int nonblock) fd_set readfds; fd_set writefds; int any, i, max_fd, n, count; - struct timeval timeout = { nonblock ? 0 : 1, 0 }; /* Use a 1s timeout. */ + struct timeval timeout = { 1, 0 }; /* Use a 1s timeout. */ void *dbg_help = NULL; FD_ZERO (&readfds); FD_ZERO (&writefds); max_fd = 0; + if (nonblock) + timeout.tv_sec = 0; DEBUG_BEGIN (dbg_help, 3, "gpgme:select on [ "); any = 0; diff --git a/gpgme/version.c b/gpgme/version.c index 836a5978..6fb05124 100644 --- a/gpgme/version.c +++ b/gpgme/version.c @@ -220,13 +220,14 @@ _gpgme_get_program_version (const char *const path) char *mark = NULL; int rp[2]; int nread; - char *argv[] = {(char *) path, "--version", 0}; + char *argv[] = {NULL /* path */, "--version", 0}; struct spawn_fd_item_s pfd[] = { {0, -1}, {-1, -1} }; struct spawn_fd_item_s cfd[] = { {-1, 1 /* STDOUT_FILENO */}, {-1, -1} }; int status; if (!path) return NULL; + argv[0] = (char *) path; if (_gpgme_io_pipe (rp, 1) < 0) return NULL; |