diff options
author | Jérémie Courrèges-Anglas <jca@wxcvbn.org> | 2014-01-03 02:20:58 +0100 |
---|---|---|
committer | Jérémie Courrèges-Anglas <jca@wxcvbn.org> | 2014-01-03 23:06:19 +0100 |
commit | e0dcdd3634c63dd6bf4ade9f07ccef90193d17b8 (patch) | |
tree | fee40dca32c6296cdc095d8a612795dcc3555ed3 /src | |
parent | e3e4dd2146df1d24887de3106c2b3cc4b44a5fb1 (diff) | |
download | ratpoison-e0dcdd3634c63dd6bf4ade9f07ccef90193d17b8.zip |
Be more verbose about failures in read_startup_files().
* If we fail with errno set to something != ENOENT then an error message
should probably be printed.
Diffstat (limited to 'src')
-rw-r--r-- | src/main.c | 19 |
1 files changed, 11 insertions, 8 deletions
@@ -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); } |