hurdextras-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

libfuse/src fuse_i.h main.c


From: Stefan Siegl
Subject: libfuse/src fuse_i.h main.c
Date: Fri, 04 Aug 2006 00:45:35 +0000

CVSROOT:        /sources/hurdextras
Module name:    libfuse
Changes by:     Stefan Siegl <stesie>   06/08/04 00:45:35

Modified files:
        src            : fuse_i.h main.c 

Log message:
        added -f switch, to force foreground operation, unless started using 
settrans

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/libfuse/src/fuse_i.h?cvsroot=hurdextras&r1=1.3&r2=1.4
http://cvs.savannah.gnu.org/viewcvs/libfuse/src/main.c?cvsroot=hurdextras&r1=1.6&r2=1.7

Patches:
Index: fuse_i.h
===================================================================
RCS file: /sources/hurdextras/libfuse/src/fuse_i.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- fuse_i.h    4 Aug 2006 00:39:36 -0000       1.3
+++ fuse_i.h    4 Aug 2006 00:45:35 -0000       1.4
@@ -123,6 +123,9 @@
   /* whether to disable multithreading (if using fuse_main) */
   unsigned disable_mt          : 1;
 
+  /* whether to fork to background or not (if started without settrans) */
+  unsigned foreground          : 1;
+
   /* the uid and gid to set and which umask to apply (if bitfields are set) */
   uid_t uid;
   gid_t gid;

Index: main.c
===================================================================
RCS file: /sources/hurdextras/libfuse/src/main.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -b -r1.6 -r1.7
--- main.c      4 Aug 2006 00:39:36 -0000       1.6
+++ main.c      4 Aug 2006 00:45:35 -0000       1.7
@@ -159,7 +159,7 @@
   int opt;
   FILE *opt_help = NULL;
 
-  while((opt = getopt(argc, argv, "d::o:hs")) >= 0)
+  while((opt = getopt(argc, argv, "d::o:hsf")) >= 0)
     switch(opt)
       {
       case 'd':
@@ -186,6 +186,10 @@
        libfuse_params.disable_mt = 1;
        break;
 
+      case 'f':
+       libfuse_params.foreground = 1;
+       break;
+
       case '?':
       default:
        opt_help = stderr;
@@ -206,6 +210,7 @@
              "    -d[FILENAME]           "
              "enable debug output (default=stderr)\n"
              "    -s                     disable multi-threaded operation\n"
+             "    -f                     don't fork to background\n"
              /* "    -r                     "
               * "mount read only (equivalent to '-o ro')\n" */
              "    -o opt,[opt...]        mount options\n"
@@ -365,7 +370,7 @@
        error(10, 0, "Unable to access underlying node");
 
       /* fork first, we are expected to act from the background */
-      pid_t pid = fork();
+      pid_t pid = libfuse_params.foreground ? 0 : fork();
       if(pid < 0)
        {
          perror(PACKAGE ": failed to fork to background");




reply via email to

[Prev in Thread] Current Thread [Next in Thread]