File tree Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -730,7 +730,18 @@ rc_runleveldir(void)
730730const char *
731731rc_svcdir (void )
732732{
733- return rc_dirs .set ? rc_dirs .svcdir : RC_SVCDIR ;
733+ static const char * svcdir ;
734+ static bool set = false;
735+
736+ if (rc_dirs .set )
737+ return rc_dirs .svcdir ;
738+
739+ if (!set && !rc_dirs .set ) {
740+ svcdir = getenv ("RC_SVCDIR" );
741+ set = true;
742+ }
743+
744+ return svcdir ? svcdir : RC_SVCDIR ;
734745}
735746
736747static ssize_t
Original file line number Diff line number Diff line change @@ -59,7 +59,7 @@ static const char *const env_allowlist[] = {
5959 "EERROR_QUIET" , "EINFO_QUIET" ,
6060 "IN_BACKGROUND" , "IN_DRYRUN" , "IN_HOTPLUG" ,
6161 "RC_DEBUG" , "RC_NODEPS" , "RC_USER_SERVICES" ,
62- "RC_SCRIPTDIRS" ,
62+ "RC_SCRIPTDIRS" , "RC_SVCDIR" ,
6363 "LANG" , "LC_MESSAGES" , "TERM" ,
6464 "EINFO_COLOR" , "EINFO_VERBOSE" ,
6565 NULL
You can’t perform that action at this time.
0 commit comments