[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [PATCH] nbd-server: raise glib version requirement



Applied, thanks.

On Sun, Mar 12, 2023 at 03:58:20AM +0900, Takuya Wakazono wrote:
> From: pastalian <pastalian46@gmail.com>
> 
> g_array_set_clear_func is only available since glib 2.32, so nbd-server
> cannot be compiled with lower versions of glib.
> This bump also makes previous workaround for old glib (dace3ad)
> unnecessary.
> 
> Signed-off-by: Takuya Wakazono <pastalian46@gmail.com>
> ---
>  configure.ac | 15 +--------------
>  nbd-server.c |  7 -------
>  2 files changed, 1 insertion(+), 21 deletions(-)
> 
> diff --git a/configure.ac b/configure.ac
> index 62e56f4..8d72e46 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -286,7 +286,7 @@ AC_CHECK_HEADERS([sys/mount.h],,,
>  [[#include <sys/param.h>
>  ]])
>  AC_CHECK_HEADERS([arpa/inet.h fcntl.h netdb.h netinet/in.h sys/ioctl.h sys/socket.h syslog.h linux/types.h sys/dirent.h sys/uio.h])
> -PKG_CHECK_MODULES(GLIB, [glib-2.0 >= 2.26.0 gthread-2.0 >= 2.26.0], [HAVE_GLIB=yes], AC_MSG_ERROR([Missing glib]))
> +PKG_CHECK_MODULES(GLIB, [glib-2.0 >= 2.32.0 gthread-2.0 >= 2.32.0], [HAVE_GLIB=yes], AC_MSG_ERROR([Missing glib]))
>  PKG_CHECK_MODULES(SW, [socket_wrapper], [HAVE_SW=yes], [HAVE_SW=no])
>  PKG_CHECK_MODULES(NW, [nss_wrapper], [HAVE_NW=yes], [HAVE_NW=no])
>  AM_CONDITIONAL(CWRAP, test "$HAVE_SW" = "yes" -a "$HAVE_NW" = "yes")
> @@ -295,19 +295,6 @@ my_save_cflags="$CFLAGS"
>  my_save_libs="$LIBS"
>  CFLAGS="-Wdeprecated-declarations -Werror $GLIB_CFLAGS"
>  LIBS="$GLIB_LIBS"
> -AC_MSG_CHECKING([if we are using an old glib 2.0 library])
> -AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
> -	[[#include <glib.h>]],
> -	[[g_thread_init(NULL);]])],
> -	[
> -		AC_MSG_RESULT(yes)
> -		AC_DEFINE(HAVE_OLD_GLIB, 1, [Define to 1 if you have an old glib library])
> -	],
> -	[
> -		AC_MSG_RESULT(no)
> -		AC_DEFINE(HAVE_OLD_GLIB, 0, [Define to 1 if you have an old glib library])
> -	]
> -)
>  dnl g_memdup2 added in glib-2.68
>  AC_CHECK_FUNCS([g_memdup2])
>  CFLAGS="$my_save_cflags"
> diff --git a/nbd-server.c b/nbd-server.c
> index 5787ddc..f942044 100644
> --- a/nbd-server.c
> +++ b/nbd-server.c
> @@ -116,10 +116,6 @@
>  
>  #include <glib.h>
>  
> -#if HAVE_OLD_GLIB
> -#include <pthread.h>
> -#endif
> -
>  /* used in cliserv.h, so must come first */
>  #define MY_NAME "nbd_server"
>  #include "cliserv.h"
> @@ -3708,9 +3704,6 @@ int main(int argc, char *argv[]) {
>  	}
>  	if (!nodaemon)
>  		daemonize();
> -#if HAVE_OLD_GLIB
> -	g_thread_init(NULL);
> -#endif
>  	tpool = g_thread_pool_new(handle_request, NULL, genconf.threads, FALSE, NULL);
>  
>  	setup_servers(servers, genconf.modernaddr, genconf.modernport,
> -- 
> 2.39.2
> 
> 

-- 
     w@uter.{be,co.za}
wouter@{grep.be,fosdem.org,debian.org}

I will have a Tin-Actinium-Potassium mixture, thanks.


Reply to: