@@ -65,6 +65,8 @@ extern int sqfs_opt_proc(void* data, const char* arg, int key, struct fuse_args*
6565#include <dirent.h>
6666#include <ctype.h>
6767
68+ const char * fusermountPath = NULL ;
69+
6870typedef struct {
6971 uint32_t lo ;
7072 uint32_t hi ;
@@ -549,18 +551,6 @@ sqfs_err private_sqfs_stat(sqfs* fs, sqfs_inode* inode, struct stat* st) {
549551
550552/* ================= End ELF parsing */
551553
552- const char * fusermountPath = getenv ("FUSERMOUNT_PROG" );
553- if (fusermountPath == 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 );
559- } else {
560- printf ("Error: fusermount not found\n" );
561- }
562- }
563-
564554extern int fusefs_main (int argc , char * argv [], void (* mounted )(void ));
565555// extern void ext2_quit(void);
566556
@@ -1687,6 +1677,18 @@ int main(int argc, char* argv[]) {
16871677 if (pid == 0 ) {
16881678 /* in child */
16891679
1680+ fusermountPath = getenv ("FUSERMOUNT_PROG" );
1681+ if (fusermountPath == NULL ) {
1682+ char * new_prog = find_fusermount ();
1683+ if (new_prog != NULL ) {
1684+ setenv ("FUSERMOUNT_PROG" , new_prog , 1 );
1685+ // printf("FUSERMOUNT_PROG set to %s\n", new_prog);
1686+ free (new_prog );
1687+ } else {
1688+ printf ("Error: fusermount not found\n" );
1689+ }
1690+ }
1691+
16901692 char * child_argv [5 ];
16911693
16921694 /* close read pipe */
0 commit comments