]> Dogcows Code - chaz/openbox/blobdiff - openbox/session.c
g_strerror
[chaz/openbox] / openbox / session.c
index 8be44e34c12a99ce4b333a243615d5354cbed37c..2fd83e983ca0b5754fcef2129cd8dd4cab7247ee 100644 (file)
@@ -163,7 +163,9 @@ void session_startup(gint *argc, gchar ***argv)
 
     sm_sessions_path = g_build_filename(parse_xdg_data_home_path(),
                                         "openbox", "sessions", NULL);
-    parse_mkdir_path(sm_sessions_path, 0700);
+    if (!parse_mkdir_path(sm_sessions_path, 0700))
+        g_warning(_("Unable to make directory '%s': %s"),
+                  sm_sessions_path, g_strerror(errno));
 
     if (save_file)
         session_load(save_file);
@@ -318,6 +320,9 @@ static gboolean session_save()
     GList *it;
     gboolean success = TRUE;
 
+    if (save_file)
+        unlink(save_file);
+
     /* this algo is from metacity */
     filename = g_strdup_printf("%d-%d-%u.obs",
                                (gint) time(NULL),
@@ -330,7 +335,7 @@ static gboolean session_save()
     if (!f) {
         success = FALSE;
         g_warning("unable to save the session to %s: %s",
-                  save_file, strerror(errno));
+                  save_file, g_strerror(errno));
     } else {
         guint stack_pos = 0;
 
@@ -420,7 +425,7 @@ static gboolean session_save()
         if (fflush(f)) {
             success = FALSE;
             g_warning("error while saving the session to %s: %s",
-                      save_file, strerror(errno));
+                      save_file, g_strerror(errno));
         }
         fclose(f);
     }
This page took 0.020931 seconds and 4 git commands to generate.