summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/main.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/main.c b/src/main.c
index 111b591..865ba98 100644
--- a/src/main.c
+++ b/src/main.c
@@ -434,14 +434,17 @@ read_startup_files (char *alt_rcfile)
if ((fileptr = fopen (filename, "r")) == NULL)
{
- /* we probably don't need to report this, its not an error */
- PRINT_DEBUG (("ratpoison: could not open %s\n", filename));
-
- if ((fileptr = fopen ("/etc/ratpoisonrc", "r")) == NULL)
- {
- /* neither is this */
- PRINT_DEBUG (("ratpoison: could not open /etc/ratpoisonrc\n"));
- }
+ if (errno != ENOENT)
+ PRINT_ERROR (("ratpoison: could not open %s (%s)\n",
+ filename, strerror (errno)));
+
+ free (filename);
+ filename = xsprintf ("%s/ratpoisonrc", "/etc");
+
+ if ((fileptr = fopen (filename, "r")) == NULL)
+ if (errno != ENOENT)
+ PRINT_ERROR (("ratpoison: could not open %s (%s)\n",
+ filename, strerror (errno)));
}
free (filename);
}