summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2014-08-11 21:32:47 +0200
committerThomas Haller <thaller@redhat.com>2014-09-24 16:12:45 +0200
commitfa18bd6e0a745004ff1fc5b1cf45c76bdb41a5a5 (patch)
tree18a51461a4d81b0b6b86fd9d34192679b96aaba0
parent3744544920173db10a2a08778169fd92e1bff802 (diff)
downloadNetworkManager-fa18bd6e0a745004ff1fc5b1cf45c76bdb41a5a5.tar.gz
platform/trivial: move code in nm-platform.c
Signed-off-by: Thomas Haller <thaller@redhat.com>
-rw-r--r--src/platform/nm-platform.c42
1 files 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)
{