diff options
author | Aleksander Morgado <aleksander@aleksander.es> | 2017-06-22 10:43:43 +0200 |
---|---|---|
committer | Aleksander Morgado <aleksander@aleksander.es> | 2017-06-22 10:43:45 +0200 |
commit | b2a859a78292175f70dac46d3999c92901fbc264 (patch) | |
tree | 9044413caa56024382f3947e2d1662a0d192707f /cli/mmcli-manager.c | |
parent | 341555504e739f7ccac11501ca874ef6b1989961 (diff) |
build: WITH_UDEV is only defined when enabled
Looks like the preprocessor doesn't choke when using #if WITH_UDEV and
it isn't defined to any value, but anyway, better explicitly say that
we're checking if it's defined or not.
Diffstat (limited to 'cli/mmcli-manager.c')
-rw-r--r-- | cli/mmcli-manager.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/cli/mmcli-manager.c b/cli/mmcli-manager.c index 5e5e60b6..ed8a9926 100644 --- a/cli/mmcli-manager.c +++ b/cli/mmcli-manager.c @@ -29,7 +29,7 @@ #include <glib.h> #include <gio/gio.h> -#if WITH_UDEV +#if defined WITH_UDEV # include <gudev/gudev.h> #endif @@ -43,7 +43,7 @@ typedef struct { MMManager *manager; GCancellable *cancellable; -#if WITH_UDEV +#if defined WITH_UDEV GUdevClient *udev; #endif } Context; @@ -56,7 +56,7 @@ static gboolean scan_modems_flag; static gchar *set_logging_str; static gchar *report_kernel_event_str; -#if WITH_UDEV +#if defined WITH_UDEV static gboolean report_kernel_event_auto_scan; #endif @@ -81,7 +81,7 @@ static GOptionEntry entries[] = { "Report kernel event", "[\"key=value,...\"]" }, -#if WITH_UDEV +#if defined WITH_UDEV { "report-kernel-event-auto-scan", 0, 0, G_OPTION_ARG_NONE, &report_kernel_event_auto_scan, "Automatically report kernel events based on udev notifications", NULL @@ -121,7 +121,7 @@ mmcli_manager_options_enabled (void) !!set_logging_str + !!report_kernel_event_str); -#if WITH_UDEV +#if defined WITH_UDEV n_actions += report_kernel_event_auto_scan; #endif @@ -133,7 +133,7 @@ mmcli_manager_options_enabled (void) if (monitor_modems_flag) mmcli_force_async_operation (); -#if WITH_UDEV +#if defined WITH_UDEV if (report_kernel_event_auto_scan) mmcli_force_async_operation (); #endif @@ -148,7 +148,7 @@ context_free (Context *ctx) if (!ctx) return; -#if WITH_UDEV +#if defined WITH_UDEV if (ctx->udev) g_object_unref (ctx->udev); #endif @@ -325,7 +325,7 @@ cancelled (GCancellable *cancellable) mmcli_async_operation_done (); } -#if WITH_UDEV +#if defined WITH_UDEV static void handle_uevent (GUdevClient *client, @@ -388,7 +388,7 @@ get_manager_ready (GObject *source, return; } -#if WITH_UDEV +#if defined WITH_UDEV if (report_kernel_event_auto_scan) { const gchar *subsys[] = { "tty", "usbmisc", "net", NULL }; guint i; @@ -480,7 +480,7 @@ mmcli_manager_run_synchronous (GDBusConnection *connection) exit (EXIT_FAILURE); } -#if WITH_UDEV +#if defined WITH_UDEV if (report_kernel_event_auto_scan) { g_printerr ("error: monitoring udev events cannot be done synchronously\n"); exit (EXIT_FAILURE); |