summaryrefslogtreecommitdiff
path: root/e2fsprogs/util.c
diff options
context:
space:
mode:
Diffstat (limited to 'e2fsprogs/util.c')
-rw-r--r--e2fsprogs/util.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/e2fsprogs/util.c b/e2fsprogs/util.c
index e59b18c..7e9c092 100644
--- a/e2fsprogs/util.c
+++ b/e2fsprogs/util.c
@@ -254,13 +254,15 @@ void make_journal_blocks(ext2_filsys fs, int journal_size, int journal_flags, in
puts("done");
}
-void e2fs_set_sbin_path(void)
+char *e2fs_set_sbin_path(void)
{
char *oldpath = getenv("PATH");
/* Update our PATH to include /sbin */
#define PATH_SET "/sbin"
- if (oldpath)
- putenv (bb_xasprintf("%s:%s", PATH_SET, oldpath));
- else
- putenv (PATH_SET);
+ if (oldpath)
+ oldpath = bb_xasprintf("%s:%s", PATH_SET, oldpath);
+ else
+ oldpath = PATH_SET;
+ putenv (oldpath);
+ return oldpath;
}