aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorWilliam Hubbs <w.d.hubbs@gmail.com>2012-10-04 22:01:33 -0500
committerWilliam Hubbs <w.d.hubbs@gmail.com>2012-10-04 22:01:33 -0500
commit361f5ce2b82765aa38a16abaeb92c475220336d3 (patch)
tree7b395693d4a2e1b4535ab86555d2b0fefb657925 /src
parentae9acfaed8401dbff3393f82468adfc33a85acf1 (diff)
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>
Diffstat (limited to 'src')
-rw-r--r--src/librc/librc-depend.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/librc/librc-depend.c b/src/librc/librc-depend.c
index 5e99c1b0..ac93716b 100644
--- a/src/librc/librc-depend.c
+++ b/src/librc/librc-depend.c
@@ -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;