mirror of
https://github.com/lbonn/rofi
synced 2024-11-27 14:21:07 +00:00
Fix #497: Create user runtime dir if not exists.
This commit is contained in:
parent
27cef3c9ae
commit
31a29e452b
1 changed files with 4 additions and 0 deletions
|
@ -676,6 +676,10 @@ int main ( int argc, char *argv[] )
|
||||||
// Create pid file path.
|
// Create pid file path.
|
||||||
const char *path = g_get_user_runtime_dir ();
|
const char *path = g_get_user_runtime_dir ();
|
||||||
if ( path ) {
|
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;
|
||||||
|
}
|
||||||
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" );
|
config_parser_add_option ( xrm_String, "pid", (void * *) &pidfile, "Pidfile location" );
|
||||||
|
|
Loading…
Reference in a new issue