1 --- encfs-orig/encfs/main.cpp 2009-11-29 23:04:12.000000000 +0100
2 +++ src/encfs-1.7.4/encfs/main.cpp 2011-09-19 11:38:35.000000000 +0200
9 // Fuse version >= 26 requires another argument to fuse_unmount, which we
10 // don't have. So use the backward compatible call instead..
17 +void handle_sigusr1(int signo)
19 + ctx->setRoot( shared_ptr<DirNode>() );
23 int main(int argc, char *argv[])
25 // initialize the logging library
28 // context is not a smart pointer because it will live for the life of
30 - EncFS_Context *ctx = new EncFS_Context;
31 + ctx = new EncFS_Context;
32 + signal(SIGUSR1,handle_sigusr1);
33 ctx->publicFilesystem = encfsArgs->opts->ownerCreate;
34 - RootPtr rootInfo = initFS( ctx, encfsArgs->opts );
37 int returnCode = EXIT_FAILURE;
40 + if (!encfsArgs->opts->mountOnDemand)
41 + rootInfo = initFS( ctx, encfsArgs->opts );
44 + if( rootInfo || encfsArgs->opts->mountOnDemand )
46 // set the globally visible root directory node
47 - ctx->setRoot( rootInfo->root );
48 + if ( encfsArgs->opts->mountOnDemand )
49 + ctx->setRoot( shared_ptr<DirNode>() );
51 + ctx->setRoot( rootInfo->root );
52 ctx->args = encfsArgs;
53 ctx->opts = encfsArgs->opts;
57 void * idleMonitor(void *_arg)
59 - EncFS_Context *ctx = (EncFS_Context*)_arg;
60 + ctx = (EncFS_Context*)_arg;
61 shared_ptr<EncFS_Args> arg = ctx->args;
63 const int timeoutCycles = 60 * arg->idleTimeout / ActivityCheckInterval;
66 + if (arg->opts->mountOnDemand)
67 + idleCycles = timeoutCycles +1;
69 pthread_mutex_lock( &ctx->wakeupMutex );