From fa18bd6e0a745004ff1fc5b1cf45c76bdb41a5a5 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Mon, 11 Aug 2014 21:32:47 +0200 Subject: [PATCH] platform/trivial: move code in nm-platform.c Signed-off-by: Thomas Haller --- src/platform/nm-platform.c | 42 +++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/src/platform/nm-platform.c b/src/platform/nm-platform.c index e26e10e158..5c62c591b5 100644 --- a/src/platform/nm-platform.c +++ b/src/platform/nm-platform.c @@ -1448,6 +1448,27 @@ nm_platform_mesh_set_ssid (int ifindex, const guint8 *ssid, gsize len) return klass->mesh_set_ssid (platform, ifindex, ssid, len); } +#define TO_STRING_DEV_BUF_SIZE (5+15+1) +static void +_to_string_dev (int ifindex, char *buf, size_t size) +{ + g_assert (buf && size >= TO_STRING_DEV_BUF_SIZE); + + if (ifindex) { + const char *name = ifindex > 0 ? nm_platform_link_get_name (ifindex) : NULL; + + strcpy (buf, " dev "); + buf += 5; + size -= 5; + + if (name) + g_strlcpy (buf, name, size); + else + g_snprintf (buf, size, "%d", ifindex); + } else + buf[0] = 0; +} + /******************************************************************/ GArray * @@ -2132,27 +2153,6 @@ source_to_string (NMPlatformSource source) return "unknown"; } -#define TO_STRING_DEV_BUF_SIZE (5+15+1) -static void -_to_string_dev (int ifindex, char *buf, size_t size) -{ - g_assert (buf && size >= TO_STRING_DEV_BUF_SIZE); - - if (ifindex){ - const char *name = ifindex > 0 ? nm_platform_link_get_name (ifindex) : NULL; - - strcpy (buf, " dev "); - buf += 5; - size -= 5; - - if (name) - g_strlcpy (buf, name, size); - else - g_snprintf (buf, size, "%d", ifindex); - } else - buf[0] = 0; -} - static const char * _lifetime_to_string (guint32 timestamp, guint32 lifetime, gint32 now, char *buf, size_t buf_size) {