diff options
author | Dave Davenport <qball@gmpclient.org> | 2017-03-25 21:52:51 +0100 |
---|---|---|
committer | Dave Davenport <qball@gmpclient.org> | 2017-03-25 21:52:51 +0100 |
commit | 0b03fc98fff53a200c0ad68d99f49e7df3017c79 (patch) | |
tree | 58850e1a6b8c544ab6193b24c81b95ba9ef9ec32 /source/rofi.c | |
parent | 61e537a05f2bccdf0fa8fd693ef0f1178e29e2bc (diff) |
If user_runtime dir does not exist, try fallback and limp on.
Diffstat (limited to 'source/rofi.c')
-rw-r--r-- | source/rofi.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/source/rofi.c b/source/rofi.c index 1392a4b2..5b85763d 100644 --- a/source/rofi.c +++ b/source/rofi.c @@ -896,10 +896,12 @@ int main ( int argc, char *argv[] ) const char *path = g_get_user_runtime_dir (); if ( path ) { if ( g_mkdir_with_parents ( path, 0700 ) < 0 ) { - fprintf ( stderr, "Failed to create user runtime directory: %s\n", strerror ( errno ) ); - return EXIT_FAILURE; + g_log ( LOG_DOMAIN, G_LOG_LEVEL_WARNING, "Failed to create user runtime directory: %s with error: %s\n", path, strerror ( errno ) ); + pidfile = g_build_filename ( g_get_home_dir (), ".rofi.pid", NULL ); + } + else { + pidfile = g_build_filename ( path, "rofi.pid", NULL ); } - pidfile = g_build_filename ( path, "rofi.pid", NULL ); } config_parser_add_option ( xrm_String, "pid", (void * *) &pidfile, "Pidfile location" ); |