X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fuuid.c;h=546d481d81d8daa5ec116fc857ffc9caa146e919;hb=295947714f23935be771c98f1071564d5567d33a;hp=89c9e7dddbe97ceba2ea8722729aee6df7463588;hpb=936c450a86c841eea89888c8550c9118fae90c25;p=collectd.git diff --git a/src/uuid.c b/src/uuid.c index 89c9e7dd..546d481d 100644 --- a/src/uuid.c +++ b/src/uuid.c @@ -33,10 +33,6 @@ #include #endif -#if HAVE_LIBHAL_H -#include -#endif - #define UUID_RAW_LENGTH 16 #define UUID_PRINTABLE_COMPACT_LENGTH (UUID_RAW_LENGTH * 2) #define UUID_PRINTABLE_NORMAL_LENGTH (UUID_PRINTABLE_COMPACT_LENGTH + 4) @@ -127,52 +123,6 @@ static char *uuid_get_from_sysctl(void) { } #endif -#if HAVE_LIBHAL_H - -#define UUID_PATH "/org/freedesktop/Hal/devices/computer" -#define UUID_PROPERTY "smbios.system.uuid" - -static char *uuid_get_from_hal(void) { - LibHalContext *ctx; - - DBusError error; - DBusConnection *con; - - dbus_error_init(&error); - - if (!(con = dbus_bus_get(DBUS_BUS_SYSTEM, &error))) - goto bailout_nobus; - - ctx = libhal_ctx_new(); - libhal_ctx_set_dbus_connection(ctx, con); - - if (!libhal_ctx_init(ctx, &error)) - goto bailout; - - if (!libhal_device_property_exists(ctx, UUID_PATH, UUID_PROPERTY, &error)) - goto bailout; - - char *uuid = - libhal_device_get_property_string(ctx, UUID_PATH, UUID_PROPERTY, &error); - if (looks_like_a_uuid(uuid)) - return (uuid); - -bailout : { - DBusError ctxerror; - dbus_error_init(&ctxerror); - if (!(libhal_ctx_shutdown(ctx, &ctxerror))) - dbus_error_free(&ctxerror); -} - - libhal_ctx_free(ctx); - -bailout_nobus: - if (dbus_error_is_set(&error)) - dbus_error_free(&error); - return (NULL); -} -#endif - static char *uuid_get_from_file(const char *path) { FILE *file; char uuid[UUID_PRINTABLE_NORMAL_LENGTH + 1] = ""; @@ -215,11 +165,6 @@ static char *uuid_get_local(void) { return (uuid); #endif -#if HAVE_LIBHAL_H - if ((uuid = uuid_get_from_hal()) != NULL) - return (uuid); -#endif - if ((uuid = uuid_get_from_dmidecode()) != NULL) return (uuid); @@ -262,17 +207,3 @@ void module_register(void) { STATIC_ARRAY_SIZE(config_keys)); plugin_register_init("uuid", uuid_init); } - -/* - * vim: set tabstop=4: - * vim: set shiftwidth=4: - * vim: set expandtab: - */ -/* - * Local variables: - * indent-tabs-mode: nil - * c-indent-level: 4 - * c-basic-offset: 4 - * tab-width: 4 - * End: - */