--- ./monitor/hal/ghalvolumemonitor.c.orig	2009-11-08 00:15:19.000000000 +0000
+++ ./monitor/hal/ghalvolumemonitor.c	2009-11-08 00:18:53.000000000 +0000
@@ -739,11 +739,23 @@
         }
       else
         {
-          char resolved_device_path[PATH_MAX];
           /* handle symlinks such as /dev/disk/by-uuid/47C2-1994 */
+#ifdef __GLIBC__
+          char *resolved_device_path;
+          resolved_device_path = realpath (device_path, NULL);
+          if (resolved_device_path != NULL &&
+              strcmp (resolved_device_path, device_file) == 0)
+            {
+              free (resolved_device_path);
+              return mount_point;
+            }
+          free (resolved_device_path);
+#else
+          char resolved_device_path[PATH_MAX];
           if (realpath (device_path, resolved_device_path) != NULL &&
               strcmp (resolved_device_path, device_file) == 0)
             return mount_point;
+#endif
         }
     }
 
--- ./monitor/gdu/ggduvolumemonitor.c.orig	2009-11-08 00:17:33.000000000 +0000
+++ ./monitor/gdu/ggduvolumemonitor.c	2009-11-08 00:22:27.000000000 +0000
@@ -695,15 +695,27 @@
         }
       else
         {
+          /* handle symlinks such as /dev/disk/by-uuid/47C2-1994 */
+#ifdef __GLIBC__
+          char *resolved_fstab_device_file;
+          resolved_fstab_device_file = realpath (fstab_device_file, NULL);
+          if (resolved_fstab_device_file != NULL &&
+              g_strcmp0 (resolved_fstab_device_file, device_file) == 0)
+            {
+              free (resolved_fstab_device_file);
+              goto out;
+            }
+          free(resolved_fstab_device_file);
+#else
           char resolved_fstab_device_file[PATH_MAX];
 
-          /* handle symlinks such as /dev/disk/by-uuid/47C2-1994 */
           if (realpath (fstab_device_file, resolved_fstab_device_file) != NULL &&
               g_strcmp0 (resolved_fstab_device_file, device_file) == 0)
             {
               ret = mount_point;
               goto out;
             }
+#endif
         }
     }
 
@@ -1384,15 +1396,29 @@
       device_file = g_unix_mount_point_get_device_path (mount_point);
       if (g_str_has_prefix (device_file, "/dev/"))
         {
-          gchar resolved_path[PATH_MAX];
           GduDevice *device;
+#ifdef __GLIBC__
+          gchar *resolved_path;
+
+          /* doesn't exist */
+          resolved_path = realpath (device_file, NULL);
+          if (resolved_path == NULL) {
+            free(resolved_path);
+            continue;
+          }
+#else
+          gchar resolved_path[PATH_MAX];
 
           /* doesn't exist */
-          if (realpath (device_file, resolved_path) != 0)
+          if (realpath (device_file, resolved_path) == NULL)
             continue;
+#endif
 
           /* is handled by DKD */
           device = gdu_pool_get_by_device_file (monitor->pool, resolved_path);
+#ifdef __GLIBC__
+          free(resolved_path);
+#endif
           if (device != NULL)
             {
               g_object_unref (device);
