Fossil SCM

Make the "fusefs" command and help text available, even on builds that lack support for FuseFS.

drh 2022-02-08 17:07 trunk
Commit b1a78a65f61e6fcc90567c9b066e7cadce9467f9a6b32f0ab565480f455edeaf
1 file changed +5 -1
+5 -1
--- src/fusefs.c
+++ src/fusefs.c
@@ -283,10 +283,11 @@
283283
static struct fuse_operations fusefs_methods = {
284284
.getattr = fusefs_getattr,
285285
.readdir = fusefs_readdir,
286286
.read = fusefs_read,
287287
};
288
+#endif /* FOSSIL_HAVE_FUSEFS */
288289
289290
/*
290291
** COMMAND: fusefs*
291292
**
292293
** Usage: %fossil fusefs [--debug] DIRECTORY
@@ -314,10 +315,11 @@
314315
** After stopping the "fossil fusefs" command, it might also be necessary
315316
** to run "fusermount -u DIRECTORY" to reset the FuseFS before using it
316317
** again.
317318
*/
318319
void fusefs_cmd(void){
320
+#ifdef FOSSIL_HAVE_FUSEFS
319321
char *zMountPoint;
320322
char *azNewArgv[5];
321323
int doDebug = find_option("debug","d",0)!=0;
322324
323325
db_find_and_open_repository(0,0);
@@ -335,12 +337,14 @@
335337
azNewArgv[4] = 0;
336338
g.localOpen = 0; /* Prevent tags like "current" and "prev" */
337339
fuse_main(4, azNewArgv, &fusefs_methods, NULL);
338340
fusefs_reset();
339341
fusefs_clear_path();
340
-}
342
+#else
343
+ fossil_fatal("The FuseFS is not available in this build.");
341344
#endif /* FOSSIL_HAVE_FUSEFS */
345
+}
342346
343347
/*
344348
** Return version numbers for the FUSE header that was used at compile-time
345349
** and/or the FUSE library that was loaded at runtime.
346350
*/
347351
--- src/fusefs.c
+++ src/fusefs.c
@@ -283,10 +283,11 @@
283 static struct fuse_operations fusefs_methods = {
284 .getattr = fusefs_getattr,
285 .readdir = fusefs_readdir,
286 .read = fusefs_read,
287 };
 
288
289 /*
290 ** COMMAND: fusefs*
291 **
292 ** Usage: %fossil fusefs [--debug] DIRECTORY
@@ -314,10 +315,11 @@
314 ** After stopping the "fossil fusefs" command, it might also be necessary
315 ** to run "fusermount -u DIRECTORY" to reset the FuseFS before using it
316 ** again.
317 */
318 void fusefs_cmd(void){
 
319 char *zMountPoint;
320 char *azNewArgv[5];
321 int doDebug = find_option("debug","d",0)!=0;
322
323 db_find_and_open_repository(0,0);
@@ -335,12 +337,14 @@
335 azNewArgv[4] = 0;
336 g.localOpen = 0; /* Prevent tags like "current" and "prev" */
337 fuse_main(4, azNewArgv, &fusefs_methods, NULL);
338 fusefs_reset();
339 fusefs_clear_path();
340 }
 
341 #endif /* FOSSIL_HAVE_FUSEFS */
 
342
343 /*
344 ** Return version numbers for the FUSE header that was used at compile-time
345 ** and/or the FUSE library that was loaded at runtime.
346 */
347
--- src/fusefs.c
+++ src/fusefs.c
@@ -283,10 +283,11 @@
283 static struct fuse_operations fusefs_methods = {
284 .getattr = fusefs_getattr,
285 .readdir = fusefs_readdir,
286 .read = fusefs_read,
287 };
288 #endif /* FOSSIL_HAVE_FUSEFS */
289
290 /*
291 ** COMMAND: fusefs*
292 **
293 ** Usage: %fossil fusefs [--debug] DIRECTORY
@@ -314,10 +315,11 @@
315 ** After stopping the "fossil fusefs" command, it might also be necessary
316 ** to run "fusermount -u DIRECTORY" to reset the FuseFS before using it
317 ** again.
318 */
319 void fusefs_cmd(void){
320 #ifdef FOSSIL_HAVE_FUSEFS
321 char *zMountPoint;
322 char *azNewArgv[5];
323 int doDebug = find_option("debug","d",0)!=0;
324
325 db_find_and_open_repository(0,0);
@@ -335,12 +337,14 @@
337 azNewArgv[4] = 0;
338 g.localOpen = 0; /* Prevent tags like "current" and "prev" */
339 fuse_main(4, azNewArgv, &fusefs_methods, NULL);
340 fusefs_reset();
341 fusefs_clear_path();
342 #else
343 fossil_fatal("The FuseFS is not available in this build.");
344 #endif /* FOSSIL_HAVE_FUSEFS */
345 }
346
347 /*
348 ** Return version numbers for the FUSE header that was used at compile-time
349 ** and/or the FUSE library that was loaded at runtime.
350 */
351

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button