summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile4
-rw-r--r--pgfuse.c21
2 files changed, 11 insertions, 14 deletions
diff --git a/Makefile b/Makefile
index ecd4c87..71b58f3 100644
--- a/Makefile
+++ b/Makefile
@@ -1,9 +1,9 @@
all: pgfuse
# for debugging
-CFLAGS = -Wall -Wextra -pedantic -g
+CFLAGS = -Wall -g -O0
# for releasing
-CFLAGS = -Wall
+#CFLAGS = -Wall -O2
# declare version of FUSE API we want to program against
CFLAGS += -DFUSE_USE_VERSION=26
diff --git a/pgfuse.c b/pgfuse.c
index 9679bc3..6cb15ce 100644
--- a/pgfuse.c
+++ b/pgfuse.c
@@ -159,9 +159,15 @@ static void print_usage( char* progname )
);
}
-static int parse_args( int argc, char *argv[] )
-{
+/* --- main --- */
+
+int main( int argc, char *argv[] )
+{
+ int res;
struct fuse_args args = FUSE_ARGS_INIT( argc, argv );
+
+ memset( &pgfuse, 0, sizeof( pgfuse ) );
+
if( fuse_opt_parse( &args, &pgfuse, pgfuse_opts, pgfuse_opt_proc ) == -1 ) {
if( pgfuse.print_help ) {
/* print our options */
@@ -180,17 +186,8 @@ static int parse_args( int argc, char *argv[] )
}
return EXIT_SUCCESS;
-}
-/* --- main --- */
+ res = fuse_main( argc, argv, &pgfuse_oper, NULL );
-int main( int argc, char *argv[] )
-{
- int res;
-
- memset( &pgfuse, 0, sizeof( pgfuse ) );
-
- res = parse_args( argc, argv );
-
exit( res );
}