From 8912421cf3829a4fd65877fd1255125c191f6f89 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sun, 15 Nov 2009 20:16:40 +0100 Subject: Use Gnulib's `inet_ntop' and `inet_pton' modules. * m4/gnulib-cache.m4: Add `inet_ntop' and `inet_pton'. * configure.ac: Don't check for `inet_ntop' and `inet_pton'. * libguile/socket.c (scm_inet_pton, scm_inet_ntop): Compile regardless of `HAVE_INET_PTON' and `HAVE_INET_NTOP' respectively. * libguile/filesys.c: Use instead of . --- lib/strftime.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'lib/strftime.c') diff --git a/lib/strftime.c b/lib/strftime.c index e3402237e..8e7f445c0 100644 --- a/lib/strftime.c +++ b/lib/strftime.c @@ -31,6 +31,7 @@ # else # include "strftime.h" # endif +# include "ignore-value.h" #endif #include @@ -198,12 +199,25 @@ extern char *tzname[]; #if FPRINTFTIME # define cpy(n, s) \ add ((n), \ + do \ + { \ if (to_lowcase) \ fwrite_lowcase (p, (s), _n); \ else if (to_uppcase) \ fwrite_uppcase (p, (s), _n); \ else \ - fwrite ((s), _n, 1, p)) + { \ + /* We are ignoring the value of fwrite here, in spite of the \ + fact that technically, that may not be valid: the fwrite \ + specification in POSIX 2008 defers to that of fputc, which \ + is intended to be consistent with the one from ISO C, \ + which permits failure due to ENOMEM *without* setting the \ + stream's error indicator. */ \ + ignore_value (fwrite ((s), _n, 1, p)); \ + } \ + } \ + while (0) \ + ) #else # define cpy(n, s) \ add ((n), \ -- cgit v1.2.3