Skip to content

Commit a1ba470

Browse files
committed
networkd: fix __FUNCTION__ macro and implicit boolean condition
1 parent d27f323 commit a1ba470

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/networkd.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,11 @@ _netplan_sysfs_get_mac_by_ifname(const char* ifname, const char* rootdir)
4242
{
4343
g_autofree gchar* content = NULL;
4444
g_autofree gchar* sysfs_path = NULL;
45-
sysfs_path = g_build_path(G_DIR_SEPARATOR_S, rootdir ?: G_DIR_SEPARATOR_S,
45+
sysfs_path = g_build_path(G_DIR_SEPARATOR_S, !!rootdir ?: G_DIR_SEPARATOR_S,
4646
"sys", "class", "net", ifname, "address", NULL);
4747

4848
if (!g_file_get_contents (sysfs_path, &content, NULL, NULL)) {
49-
g_debug("%s: Cannot read file contents.", __FUNCTION__);
49+
g_debug("%s: Cannot read file contents.", __func__);
5050
return NULL;
5151
}
5252

@@ -63,12 +63,12 @@ _netplan_sysfs_get_driver_by_ifname(const char* ifname, const char* rootdir)
6363
{
6464
g_autofree gchar* link = NULL;
6565
g_autofree gchar* sysfs_path = NULL;
66-
sysfs_path = g_build_path(G_DIR_SEPARATOR_S, rootdir ?: G_DIR_SEPARATOR_S,
66+
sysfs_path = g_build_path(G_DIR_SEPARATOR_S, !!rootdir ?: G_DIR_SEPARATOR_S,
6767
"sys", "class", "net", ifname, "device", "driver", NULL);
6868

6969
link = g_file_read_link(sysfs_path, NULL);
7070
if (!link) {
71-
g_debug("%s: Cannot read symlink of %s.", __FUNCTION__, sysfs_path);
71+
g_debug("%s: Cannot read symlink of %s.", __func__, sysfs_path);
7272
return NULL;
7373
}
7474

0 commit comments

Comments
 (0)