]> Dogcows Code - chaz/openbox/blobdiff - openbox/openbox.c
show a message if chdir() fails
[chaz/openbox] / openbox / openbox.c
index 7c68e2a5d93b9bcbcbf357f88b5e7ab450295365..b688296516911f2afee8254577a00635c3d60d4c 100644 (file)
@@ -62,6 +62,7 @@
 #ifdef HAVE_UNISTD_H
 #  include <unistd.h>
 #endif
+#include <errno.h>
 
 #include <X11/cursorfont.h>
 
@@ -101,7 +102,9 @@ gint main(gint argc, gchar **argv)
 
     g_set_prgname(argv[0]);
 
-    chdir(g_get_home_dir());
+    if (chdir(g_get_home_dir()) == -1)
+        g_warning("Unable to change to home directory (%s): %s",
+                  g_get_home_dir(), g_strerror(errno));
      
     parse_paths_startup();
 
@@ -311,6 +314,7 @@ gint main(gint argc, gchar **argv)
             } else {
                 g_warning("failed to execute '%s': %s", restart_path,
                           err->message);
+                g_error_free(err);
             }
         }
 
This page took 0.023806 seconds and 4 git commands to generate.