Enable to fall back /etc/machine-id
authorfujiwarat <takao.fujiwara1@gmail.com>
Fri, 27 Apr 2012 02:27:03 +0000 (11:27 +0900)
committerfujiwarat <takao.fujiwara1@gmail.com>
Fri, 27 Apr 2012 02:27:03 +0000 (11:27 +0900)
http://cgit.freedesktop.org/dbus/dbus/commit/dbus/dbus-sysdeps-unix.c?id=66e52541d5bdd4927a5c702963749760643313f4

BUG=http://code.google.com/p/ibus/issues/detail?id=1389
TEST=Linux desktop

Review URL: https://codereview.appspot.com/6111060

src/ibusshare.c

index 95f98d3475b7132216f269d10c8bf56aa0475c82..ce332ba5523cf96ad0b3049ecf4000c553e6a937 100644 (file)
@@ -44,7 +44,11 @@ ibus_get_local_machine_id (void)
         if (!g_file_get_contents ("/var/lib/dbus/machine-id",
                                   &machine_id,
                                   NULL,
-                                  &error)) {
+                                  &error) &&
+            !g_file_get_contents ("/etc/machine-id",
+                                  &machine_id,
+                                  NULL,
+                                  NULL)) {
             g_warning ("Unable to load /var/lib/dbus/machine-id: %s", error->message);
             g_error_free (error);
             machine_id = "machine-id";