aboutsummaryrefslogtreecommitdiffstats
path: root/jnlib
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2008-03-20 15:31:43 +0000
committerWerner Koch <[email protected]>2008-03-20 15:31:43 +0000
commitc2a8254be71089f707b3100972609db9cf4d02a0 (patch)
tree109ea1f31fdfe85524fca8107edbab7a5888f425 /jnlib
parentFix for v3 keys. (diff)
downloadgnupg-c2a8254be71089f707b3100972609db9cf4d02a0.tar.gz
gnupg-c2a8254be71089f707b3100972609db9cf4d02a0.zip
Fix a bug in the ambigious name detection.
Minor cleanups.
Diffstat (limited to 'jnlib')
-rw-r--r--jnlib/ChangeLog7
-rw-r--r--jnlib/dotlock.c3
-rw-r--r--jnlib/logging.c8
3 files changed, 14 insertions, 4 deletions
diff --git a/jnlib/ChangeLog b/jnlib/ChangeLog
index 9838409c6..40093105f 100644
--- a/jnlib/ChangeLog
+++ b/jnlib/ChangeLog
@@ -1,3 +1,10 @@
+2008-03-17 Werner Koch <[email protected]>
+
+ * logging.c (my_funopen_hook_size_t): New.
+ (fun_writer): Use it to cope with fopencookie/funopen differences.
+ * dotlock.c (read_lockfile): Initialize PID. Reported by Stéphane
+ Corthésy.
+
2008-02-22 Werner Koch <[email protected]>
* argparse.c (strusage): Set copyright year to 2008.
diff --git a/jnlib/dotlock.c b/jnlib/dotlock.c
index 079723ce9..e1964fd26 100644
--- a/jnlib/dotlock.c
+++ b/jnlib/dotlock.c
@@ -454,7 +454,8 @@ read_lockfile (DOTLOCK h, int *same_node )
#else
char buffer_space[10+1+70+1]; /* 70 is just an estimated value; node
name are usually shorter. */
- int fd, pid;
+ int fd;
+ int pid = -1;
char *buffer, *p;
size_t expected_len;
int res, nread;
diff --git a/jnlib/logging.c b/jnlib/logging.c
index 37ae207f3..d4418c915 100644
--- a/jnlib/logging.c
+++ b/jnlib/logging.c
@@ -48,8 +48,10 @@
#ifdef HAVE_FOPENCOOKIE
typedef ssize_t my_funopen_hook_ret_t;
+typedef size_t my_funopen_hook_size_t;
#else
typedef int my_funopen_hook_ret_t;
+typedef int my_funopen_hook_size_t;
#endif
@@ -117,7 +119,7 @@ writen (int fd, const void *buffer, size_t nbytes)
static my_funopen_hook_ret_t
-fun_writer (void *cookie_arg, const char *buffer, size_t size)
+fun_writer (void *cookie_arg, const char *buffer, my_funopen_hook_size_t size)
{
struct fun_cookie_s *cookie = cookie_arg;
@@ -188,7 +190,7 @@ fun_writer (void *cookie_arg, const char *buffer, size_t size)
log_socket = cookie->fd;
if (cookie->fd != -1 && !writen (cookie->fd, buffer, size))
- return size; /* Okay. */
+ return (my_funopen_hook_ret_t)size; /* Okay. */
if (!running_detached && cookie->fd != -1
&& isatty (fileno (stderr)))
@@ -207,7 +209,7 @@ fun_writer (void *cookie_arg, const char *buffer, size_t size)
log_socket = -1;
}
- return size;
+ return (my_funopen_hook_ret_t)size;
}
static int