mirror of
https://github.com/OpenRC/openrc.git
synced 2024-11-27 20:03:29 +08:00
set the RC_UNAME environment variable when updating dependencies
This is needed because the network script uses this variable in the depend() function but it wasn't exported when this was run. Reported-by: <aaly90@gmail.com>
This commit is contained in:
parent
ae9acfaed8
commit
361f5ce2b8
@ -28,6 +28,8 @@
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include <sys/utsname.h>
|
||||
|
||||
#include "librc.h"
|
||||
|
||||
#define GENDEP RC_LIBEXECDIR "/sh/gendepends.sh"
|
||||
@ -747,12 +749,15 @@ rc_deptree_update(void)
|
||||
size_t i, k, l;
|
||||
bool retval = true;
|
||||
const char *sys = rc_sys();
|
||||
struct utsname uts;
|
||||
|
||||
/* Some init scripts need RC_LIBEXECDIR to source stuff
|
||||
Ideally we should be setting our full env instead */
|
||||
if (!getenv("RC_LIBEXECDIR"))
|
||||
setenv("RC_LIBEXECDIR", RC_LIBEXECDIR, 0);
|
||||
|
||||
if (uname(&uts) == 0)
|
||||
setenv("RC_UNAME", uts.sysname, 1);
|
||||
/* Phase 1 - source all init scripts and print dependencies */
|
||||
if (!(fp = popen(GENDEP, "r")))
|
||||
return false;
|
||||
|
Loading…
Reference in New Issue
Block a user