commit 1832dd9806b5d4ceacbe80baf2c10cd03cf8486d
parent 7851fcfdc77d44f2ca1f85026e0c4b9c9d0a69f3
Author: Mauricio Günther <mauricio@140774ce-b5e7-0310-ab8b-a85725594a96>
Date: Fri, 16 Mar 2012 08:07:55 +0000
-changes
Diffstat:
2 files changed, 32 insertions(+), 7 deletions(-)
diff --git a/src/ext/Makefile.am b/src/ext/Makefile.am
@@ -9,7 +9,7 @@ INCLUDES = \
bin_PROGRAMS = gnunet-fuse
gnunet_fuse_SOURCES = \
- gnunet-fuse.c
+ gnunet-fuse.c
directory.c \
dirent.c \
file.c \
diff --git a/src/ext/gnunet-fuse.c b/src/ext/gnunet-fuse.c
@@ -25,6 +25,7 @@
*/
#define FUSE_USE_VERSION 26
+#define TESTING GNUNET_YES
#include <gnunet/platform.h>
#include <gnunet/gnunet_util_lib.h>
@@ -218,15 +219,39 @@ run (void *cls,
const char *cfgfile,
const struct GNUNET_CONFIGURATION_Handle *cfg)
{
-
+ int argc;
ret = 0;
-
- char *a[2];
+ if (NULL == directory)
+ {
+ printf("ERROR\n-d option for mountpoint required\n");
+ ret = 1;
+ return;
+ }
+ if (NULL == source)
+ {
+ printf("ERROR\n-s option for mountpoint required\n");
+ ret = 2;
+ return;
+ }
+
+ if (GNUNET_YES == TESTING)
+ {
+ argc = 3;
+ }
+ else
+ {
+ argc = 2;
+ }
+ char *a[argc];
a[0]="gnunet-fuse";
a[1]= directory;
- if (a[1] == 0) printf("ERROR\n-d option for mountpoint required\n");
- else
- fuse_main(2, a, &fops, NULL);
+ if (GNUNET_YES == TESTING)
+ {
+ a[2] = "-s";
+ }
+
+
+ fuse_main(argc, a, &fops, NULL);
}