Fossil SCM

Fix to the fusefs.c file so that it builds even without FOSSIL_HAVE_FUSEFS.

drh 2016-10-31 16:02 trunk
Commit 9a4a5dec3d0a9a1ccb133518d6180e4e598eefad
1 file changed +7 -3
+7 -3
--- src/fusefs.c
+++ src/fusefs.c
@@ -20,20 +20,20 @@
2020
**
2121
** This module is a mostly a no-op unless compiled with -DFOSSIL_HAVE_FUSEFS.
2222
** The FOSSIL_HAVE_FUSEFS should be omitted on systems that lack support for
2323
** the Fuse Filesystem, of course.
2424
*/
25
-#ifdef FOSSIL_HAVE_FUSEFS
2625
#include "config.h"
26
+#include "fusefs.h"
27
+#ifdef FOSSIL_HAVE_FUSEFS
2728
#include <stdio.h>
2829
#include <string.h>
2930
#include <errno.h>
3031
#include <fcntl.h>
3132
#include <stdlib.h>
3233
#include <unistd.h>
3334
#include <sys/types.h>
34
-#include "fusefs.h"
3535
3636
#define FUSE_USE_VERSION 26
3737
#include <fuse.h>
3838
3939
/*
@@ -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,13 @@
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
+#ifndef FOSSIL_HAVE_FUSEFS
321
+ fossil_fatal("fusefs not supported in this build");
322
+#else
319323
char *zMountPoint;
320324
char *azNewArgv[5];
321325
int doDebug = find_option("debug","d",0)!=0;
322326
323327
db_find_and_open_repository(0,0);
@@ -335,7 +339,7 @@
335339
azNewArgv[4] = 0;
336340
g.localOpen = 0; /* Prevent tags like "current" and "prev" */
337341
fuse_main(4, azNewArgv, &fusefs_methods, NULL);
338342
fusefs_reset();
339343
fusefs_clear_path();
344
+#endif
340345
}
341
-#endif /* FOSSIL_HAVE_FUSEFS */
342346
--- src/fusefs.c
+++ src/fusefs.c
@@ -20,20 +20,20 @@
20 **
21 ** This module is a mostly a no-op unless compiled with -DFOSSIL_HAVE_FUSEFS.
22 ** The FOSSIL_HAVE_FUSEFS should be omitted on systems that lack support for
23 ** the Fuse Filesystem, of course.
24 */
25 #ifdef FOSSIL_HAVE_FUSEFS
26 #include "config.h"
 
 
27 #include <stdio.h>
28 #include <string.h>
29 #include <errno.h>
30 #include <fcntl.h>
31 #include <stdlib.h>
32 #include <unistd.h>
33 #include <sys/types.h>
34 #include "fusefs.h"
35
36 #define FUSE_USE_VERSION 26
37 #include <fuse.h>
38
39 /*
@@ -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,13 @@
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,7 +339,7 @@
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
--- src/fusefs.c
+++ src/fusefs.c
@@ -20,20 +20,20 @@
20 **
21 ** This module is a mostly a no-op unless compiled with -DFOSSIL_HAVE_FUSEFS.
22 ** The FOSSIL_HAVE_FUSEFS should be omitted on systems that lack support for
23 ** the Fuse Filesystem, of course.
24 */
 
25 #include "config.h"
26 #include "fusefs.h"
27 #ifdef FOSSIL_HAVE_FUSEFS
28 #include <stdio.h>
29 #include <string.h>
30 #include <errno.h>
31 #include <fcntl.h>
32 #include <stdlib.h>
33 #include <unistd.h>
34 #include <sys/types.h>
 
35
36 #define FUSE_USE_VERSION 26
37 #include <fuse.h>
38
39 /*
@@ -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,13 @@
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 #ifndef FOSSIL_HAVE_FUSEFS
321 fossil_fatal("fusefs not supported in this build");
322 #else
323 char *zMountPoint;
324 char *azNewArgv[5];
325 int doDebug = find_option("debug","d",0)!=0;
326
327 db_find_and_open_repository(0,0);
@@ -335,7 +339,7 @@
339 azNewArgv[4] = 0;
340 g.localOpen = 0; /* Prevent tags like "current" and "prev" */
341 fuse_main(4, azNewArgv, &fusefs_methods, NULL);
342 fusefs_reset();
343 fusefs_clear_path();
344 #endif
345 }
 
346

Keyboard Shortcuts

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