Messi gli esempi nel testo e usata daemon dove serve nei server
[gapil.git] / sources / FortuneServer.c
index 69e3b3413962faf3059c58fe0d1dd91d4f5dde88..8ba3a2fc65b158cd48a58d3130e37b9086cb7f02 100644 (file)
@@ -26,7 +26,7 @@
  *
  * Usage: fortuned -h give all info
  *
  *
  * Usage: fortuned -h give all info
  *
- * $Id: FortuneServer.c,v 1.4 2002/08/19 17:34:23 piccardi Exp $
+ * $Id: FortuneServer.c,v 1.6 2003/01/12 00:24:28 piccardi Exp $
  *
  ****************************************************************/
 /* 
  *
  ****************************************************************/
 /* 
@@ -43,7 +43,7 @@
 #include <fcntl.h>      /*  */
 
 #include "macros.h"
 #include <fcntl.h>      /*  */
 
 #include "macros.h"
-#include "wrappers.h"
+#include "Gapil.h"
 
 /* Subroutines declaration */
 void usage(void);
 
 /* Subroutines declaration */
 void usage(void);
@@ -56,7 +56,7 @@ int main(int argc, char *argv[])
 {
 /* Variables definition */
     int i, n = 0;
 {
 /* Variables definition */
     int i, n = 0;
-    char *fortunefilename = "/usr/share/games/fortunes/italia";
+    char *fortunefilename = "/usr/share/games/fortunes/linux";
     char **fortune;
     char line[80];
     int fifo_server, fifo_client;
     char **fortune;
     char line[80];
     int fifo_server, fifo_client;
@@ -112,6 +112,7 @@ int main(int argc, char *argv[])
            exit(1);
        }
     }
            exit(1);
        }
     }
+    daemon(0, 0);
     /* open fifo two times to avoid EOF */
     fifo_server = open(fifoname, O_RDONLY);
     if (fifo_server < 0) {
     /* open fifo two times to avoid EOF */
     fifo_server = open(fifoname, O_RDONLY);
     if (fifo_server < 0) {