summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: fb6ffa4)
raw | patch | inline | side by side (parent: fb6ffa4)
author | Max Kellermann <max@duempel.org> | |
Mon, 14 Jul 2014 09:24:42 +0000 (11:24 +0200) | ||
committer | Max Kellermann <max@duempel.org> | |
Mon, 14 Jul 2014 09:24:42 +0000 (11:24 +0200) |
src/conf.c | patch | blob | history | |
src/conf.h | patch | blob | history | |
src/screen_keydef.c | patch | blob | history |
diff --git a/src/conf.c b/src/conf.c
index 1f1f0bc39f0754b3cd847b2f327ffc6b04ab85db..171a9ee49d57d073f76e6f491c58efb5d8f126e7 100644 (file)
--- a/src/conf.c
+++ b/src/conf.c
return 0;
}
-int
+bool
check_user_conf_dir(void)
{
char *directory = g_build_filename(g_get_home_dir(), "." PACKAGE, NULL);
if (g_file_test(directory, G_FILE_TEST_IS_DIR)) {
g_free(directory);
- return 0;
+ return true;
}
- int retval = g_mkdir(directory, 0755);
+ bool success = g_mkdir(directory, 0755) == 0;
g_free(directory);
- return retval;
+ return success;
}
char *
diff --git a/src/conf.h b/src/conf.h
index a9503ad3821834d2432577263d96744890c6d0a4..03b67cc93ae34642469ad0d9761022a8ef4bd4f5 100644 (file)
--- a/src/conf.h
+++ b/src/conf.h
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-int check_user_conf_dir(void);
+#include <stdbool.h>
+
+bool
+check_user_conf_dir(void);
char *build_user_conf_filename(void);
char *build_system_conf_filename(void);
diff --git a/src/screen_keydef.c b/src/screen_keydef.c
index 164cf6565822adc0d2f8f74df3b6748b76e435cd..b947dd8f0ebf022634efedfa9781bb4fa5bfe94f 100644 (file)
--- a/src/screen_keydef.c
+++ b/src/screen_keydef.c
static int
save_keys(void)
{
- if (check_user_conf_dir()) {
+ if (!check_user_conf_dir()) {
screen_status_printf(_("Error: Unable to create directory ~/.ncmpc - %s"),
strerror(errno));
screen_bell();