From 9bd34b95333a4806e50616db89bf5d4cf463541a Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Wed, 18 Feb 2004 18:06:13 +0000 Subject: (assuan_get_data_fp): Fail with ENOSYS if we can't implement this. --- NEWS | 3 +++ configure.ac | 16 ++++++++++++---- src/ChangeLog | 5 +++++ src/assuan-handler.c | 5 +++++ 4 files changed, 25 insertions(+), 4 deletions(-) diff --git a/NEWS b/NEWS index d21363f..3f547e7 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,9 @@ Noteworthy changes in version 0.6.4 ------------------------------------------------ + * Will now also build on systems not providing funopen or + fopencookie. + Noteworthy changes in version 0.6.3 (2004-01-29) ------------------------------------------------ diff --git a/configure.ac b/configure.ac index 45aff1e..3f67b73 100644 --- a/configure.ac +++ b/configure.ac @@ -91,12 +91,20 @@ AC_CHECK_FUNCS(flockfile funlockfile) # Check for funopen AC_CHECK_FUNCS(funopen) if test $ac_cv_func_funopen != yes; then - # No funopen but we can implement that in terms of fopencookie. - AC_CHECK_FUNCS(fopencookie, AC_LIBOBJ(funopen), AC_MSG_ERROR([[ -No implementation of fopencookie or funopen available. -]])) + # No funopen but we can implement that in terms of fopencookie. + AC_CHECK_FUNCS(fopencookie) + if test $ac_cv_func_fopencookie = yes; then + AC_LIBOBJ([funopen]) + else + AC_MSG_WARN([ +*** +*** No implementation of fopencookie or funopen available. +*** The assuan_get_data_fp feature won't work. +***]) + fi fi + AC_REPLACE_FUNCS(isascii) AC_REPLACE_FUNCS(putc_unlocked) AC_REPLACE_FUNCS(memrchr) diff --git a/src/ChangeLog b/src/ChangeLog index 00825fb..fa5968a 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2004-02-18 Werner Koch + + * assuan-handler.c (assuan_get_data_fp): Fail with ENOSYS if we + can't implement this. + 2004-02-15 Werner Koch * memrchr.c (memrchr): Fixed implementation. Taken from gpgme. diff --git a/src/assuan-handler.c b/src/assuan-handler.c index f135bc2..478a1e5 100644 --- a/src/assuan-handler.c +++ b/src/assuan-handler.c @@ -637,6 +637,7 @@ assuan_get_active_fds (ASSUAN_CONTEXT ctx, int what, FILE * assuan_get_data_fp (ASSUAN_CONTEXT ctx) { +#if defined (HAVE_FOPENCOOKIE) || defined (HAVE_FUNOPEN) if (ctx->outbound.data.fp) return ctx->outbound.data.fp; @@ -646,6 +647,10 @@ assuan_get_data_fp (ASSUAN_CONTEXT ctx) 0, _assuan_cookie_write_flush); ctx->outbound.data.error = 0; return ctx->outbound.data.fp; +#else + errno = ENOSYS; + return NULL; +#endif } -- cgit v1.2.3