Skip to content

Commit 4913966

Browse files
authored
char* new_prog = find_fusermount();
1 parent 2ab4fa5 commit 4913966

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/runtime/runtime.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -549,13 +549,13 @@ sqfs_err private_sqfs_stat(sqfs* fs, sqfs_inode* inode, struct stat* st) {
549549

550550
/* ================= End ELF parsing */
551551

552-
char* fusermount_prog;
553-
fusermount_prog = getenv("FUSERMOUNT_PROG");
554-
if (fusermount_prog == NULL) {
555-
fusermount_prog = find_fusermount();
556-
if (fusermount_prog != NULL) {
557-
// printf("FUSERMOUNT_PROG set to %s\n", fusermount_prog);
558-
free(fusermount_prog);
552+
char* fusermount_prog = getenv("FUSERMOUNT_PROG");
553+
if (fusermount_prog == NULL) {
554+
char* new_prog = find_fusermount();
555+
if (new_prog != NULL) {
556+
setenv("FUSERMOUNT_PROG", new_prog, 1);
557+
// printf("FUSERMOUNT_PROG set to %s\n", new_prog);
558+
free(new_prog);
559559
} else {
560560
printf("Error: fusermount not found\n");
561561
}

0 commit comments

Comments
 (0)