infiniband-diags: rdma-ndd: remove udev logging when not supported
PATCH 1/1 infiniband-diags: rdma-ndd: remove udev logging when not supported
From: Ira Weiny <[email protected]>
udev_set_log_* functions are deprecated on newer versions of libudev Conditionally compile out the use of these functions.
Signed-off-by Ira Weiny <[email protected]>
--- configure.ac | 8 ++++++++ src/rdma-ndd.c | 4 ++++ 2 files changed, 12 insertions(+)
configure.ac +8 -0
@@ -215,6 +215,14 @@ AS_IF([test x$rdmandd = xyes], [ AC_CONFIG_FILES([doc/man/rdma-ndd.8 etc/rdma-ndd.init]) AC_SUBST([UDEV_CFLAGS]) AC_SUBST([UDEV_LIBS]) + if test "$with_udev" = "yes"; then + PKG_CHECK_EXISTS(libudev >= 218, [with_dev_logging=no], + [with_udev_logging=yes]) + if test "$with_udev_logging" = "yes"; then + AC_DEFINE_UNQUOTED([HAVE_UDEV_LOGGING], 1, + [whether libudev logging can be used]) + fi + fi ]) dnl Generate doc/man/*.in files if possible
src/rdma-ndd.c +4 -0
@@ -232,6 +232,7 @@ static int process_opts(void *context, int ch, char *optarg)return 0 ; } +#if HAVE_UDEV_LOGGING #define MSG_MAX 2048static void udev_log_fn (struct udev *ud,int priority,const char *file,int line,const char *fn,const char *format,va_list args)
@@ -244,6 +245,7 @@ static void udev_log_fn(struct udev *ud, int priority, const char *file, int linvsnprintf (msg+off,MSG_MAX -off, format, args); syslog(LOG_ERR, "%s", msg); } +#endif static void setup_udev (void ) {
@@ -253,8 +255,10 @@ static void setup_udev(void)return ; } +#if HAVE_UDEV_LOGGING udev_set_log_fn (udev, udev_log_fn);udev_set_log_priority (udev,LOG_INFO ); +#endif }static int get_udev_fd (void )
Signature · 6 lines
1.8.2 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html