File tree Expand file tree Collapse file tree 2 files changed +11
-10
lines changed
Expand file tree Collapse file tree 2 files changed +11
-10
lines changed Original file line number Diff line number Diff line change @@ -370,8 +370,8 @@ rc_sys(void)
370370char *
371371rc_sysconfdir_get (void ) {
372372 static char path [PATH_MAX ] = { 0 };
373- if (geteuid () != 0 ) {
374- if (! * path ) {
373+ if (! * path ) {
374+ if (geteuid () != 0 ) {
375375 char * config_path ;
376376 if ((config_path = getenv ("XDG_CONFIG_HOME" ))) {
377377 snprintf (path , PATH_MAX , "%s" , config_path );
@@ -380,18 +380,18 @@ rc_sysconfdir_get(void) {
380380 } else {
381381 exit (1 );
382382 }
383+ } else {
384+ snprintf (path , PATH_MAX , "%s" , RC_SYSCONFDIR );
383385 }
384- return path ;
385- } else {
386- return RC_SYSCONFDIR ;
387386 }
387+ return path ;
388388}
389389
390390char *
391391rc_svcdir_get (void ) {
392392 static char path [PATH_MAX ] = { 0 };
393- if (geteuid () != 0 ) {
394- if (! * path ) {
393+ if (! * path ) {
394+ if (geteuid () != 0 ) {
395395 char * config_path ;
396396 if ((config_path = getenv ("XDG_RUNTIME_DIR" )) ||
397397 (config_path = getenv ("XDG_DATA_HOME" ))) {
@@ -402,11 +402,11 @@ rc_svcdir_get(void) {
402402 } else {
403403 exit (1 );
404404 }
405+ } else {
406+ snprintf (path , PATH_MAX , "%s" , RC_SVCDIR );
405407 }
406- return path ;
407- } else {
408- return RC_SVCDIR ;
409408 }
409+ return path ;
410410}
411411
412412char *
Original file line number Diff line number Diff line change @@ -133,6 +133,7 @@ char *rc_initdir_get(void);
133133char * rc_confdir_get (void );
134134char * rc_svcdir_get (void );
135135char * rc_runtimedir_get (void );
136+ char * rc_runleveldir_get (void );
136137
137138/*! Return the current runlevel.
138139 * @return the current runlevel */
You can’t perform that action at this time.
0 commit comments