FreeBSD supports addr and if_running
authorNikos Ntarmos <ntarmos@cs.uoi.gr>
Sun, 5 Dec 2010 03:57:40 +0000 (05:57 +0200)
committerPavel Labath <pavelo@centrum.sk>
Thu, 9 Dec 2010 18:27:22 +0000 (19:27 +0100)
Signed-off-by: Nikos Ntarmos <ntarmos@cs.uoi.gr>
Signed-off-by: Pavel Labath <pavelo@centrum.sk>

src/core.c

index 5a146f9..e93ef58 100644 (file)
@@ -541,11 +541,11 @@ struct text_object *construct_text_object(const char *s, const char *arg, long
                parse_platform_sensor(obj, arg);
        END OBJ_ARG(hwmon, 0, "hwmon needs argumanets")
                parse_hwmon_sensor(obj, arg);
-       END OBJ(addr, &update_net_stats)
-               parse_net_stat_arg(obj, arg, free_at_crash);
        END OBJ(addrs, &update_net_stats)
                parse_net_stat_arg(obj, arg, free_at_crash);
 #endif /* __linux__ */
+       END OBJ(addr, &update_net_stats)
+               parse_net_stat_arg(obj, arg, free_at_crash);
        END
        /* we have four different types of top (top, top_mem, top_time and top_io). To
         * avoid having almost-same code four times, we have this special
@@ -577,7 +577,7 @@ struct text_object *construct_text_object(const char *s, const char *arg, long
                obj->data.s = strndup(arg, text_buffer_size);
        END OBJ_IF_ARG(if_mounted, 0, "if_mounted needs an argument")
                obj->data.s = strndup(arg, text_buffer_size);
-#ifdef __linux__
+#if defined(__linux__) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
        END OBJ_IF_ARG(if_running, &update_top, "if_running needs an argument")
                top_running = 1;
                obj->data.s = strndup(arg, text_buffer_size);