Manpage patch from Evan Gates.
[surf.git] / surf.c
diff --git a/surf.c b/surf.c
index bff621b..27cc4e9 100644 (file)
--- a/surf.c
+++ b/surf.c
@@ -128,11 +128,14 @@ buildpath(const char *path) {
        if((p = strrchr(apath, '/'))) {
                *p = '\0';
                g_mkdir_with_parents(apath, 0700);
+               g_chmod(apath, 0700); /* in case it existed */
                *p = '/';
        }
        /* creating file (gives error when apath ends with "/") */
-       if((f = fopen(apath, "a")))
+       if((f = fopen(apath, "a"))) {
+               g_chmod(apath, 0600); /* always */
                fclose(f);
+       }
        return apath;
 }
 
@@ -545,6 +548,9 @@ newclient(void) {
                gdk_display_sync(gtk_widget_get_display(c->win));
                printf("%u\n", (guint)GDK_WINDOW_XID(GTK_WIDGET(c->win)->window));
                fflush(NULL);
+                if (fclose(stdout) != 0) {
+                       die("Error closing stdout");
+                }
        }
        return c;
 }