summary refs log tree commit diff
path: root/src/devices/nm-acd-manager.c
diff options
context:
space:
mode:
authorMichael Biebl <biebl@debian.org>2020-05-08 21:41:46 +0200
committerMichael Biebl <biebl@debian.org>2020-05-08 21:41:46 +0200
commit14a437f08bfacbdbe3ed3d4e36dcf8a199df8e9e (patch)
tree036108c3f080f94e794f52be66cc2bab2158486e /src/devices/nm-acd-manager.c
parent9df39b936fcb2f3d27ff7e653e645c16900807e3 (diff)
parentd460892bbfece74fb6d3cd846bf6ef548290be41 (diff)
Update upstream source from tag 'upstream/1.24.0'
Update to upstream version '1.24.0'
with Debian dir 36f1778d11d8b638b63bd623816627ac76cb75ee
Diffstat (limited to 'src/devices/nm-acd-manager.c')
-rw-r--r--src/devices/nm-acd-manager.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/devices/nm-acd-manager.c b/src/devices/nm-acd-manager.c
index 735dd25b..1c6c42a0 100644
--- a/src/devices/nm-acd-manager.c
+++ b/src/devices/nm-acd-manager.c
@@ -81,7 +81,20 @@ _acd_event_to_string (unsigned int event)
 	return NULL;
 }
 
-#define acd_event_to_string_a(event) NM_UTILS_LOOKUP_STR_A (_acd_event_to_string, event)
+#define ACD_EVENT_TO_STRING_BUF_SIZE 50
+
+static const char *
+_acd_event_to_string_buf (unsigned event, char buffer[static ACD_EVENT_TO_STRING_BUF_SIZE])
+{
+	const char *s;
+
+	s = _acd_event_to_string (event);
+	if (s)
+		return s;
+
+	g_snprintf (buffer, ACD_EVENT_TO_STRING_BUF_SIZE, "(%u)", event);
+	return buffer;
+}
 
 static const char *
 acd_error_to_string (int error)
@@ -172,6 +185,7 @@ acd_event (int fd,
 
 	while (   !n_acd_pop_event (self->acd, &event)
 	       && event) {
+		char to_string_buffer[ACD_EVENT_TO_STRING_BUF_SIZE];
 		gs_free char *hwaddr_str = NULL;
 		gboolean check_probing_done = FALSE;
 
@@ -215,7 +229,7 @@ acd_event (int fd,
 			       nm_platform_link_get_name (NM_PLATFORM_GET, self->ifindex));
 			break;
 		default:
-			_LOGD ("unhandled event '%s'", acd_event_to_string_a (event->event));
+			_LOGD ("unhandled event '%s'", _acd_event_to_string_buf (event->event, to_string_buffer));
 			break;
 		}