X-Git-Url: https://gapil.gnulinux.it/gitweb/?p=gapil.git;a=blobdiff_plain;f=sources%2FMQFortuneServer.c;h=0f56bdef7a7880fc92d7bc6621cb169ab2f59697;hp=cae21ea717d30b6e91d864c9fea968364b5f1fb1;hb=72b2686a82a62331891ca894a6c3b476365363fc;hpb=59b107d5207f19e0049bbd1032e10cba660da92e diff --git a/sources/MQFortuneServer.c b/sources/MQFortuneServer.c index cae21ea..0f56bde 100644 --- a/sources/MQFortuneServer.c +++ b/sources/MQFortuneServer.c @@ -26,7 +26,7 @@ * * Usage: fortuned -h give all info * - * $Id: MQFortuneServer.c,v 1.3 2002/12/03 11:06:05 piccardi Exp $ + * $Id: MQFortuneServer.c,v 1.4 2003/01/12 16:10:07 piccardi Exp $ * ****************************************************************/ /* @@ -60,7 +60,7 @@ int main(int argc, char *argv[]) /* Variables definition */ int i, n = 0; char **fortune; /* array of fortune message string */ - char *fortunefilename; /* fortune file name */ + char *fortunefilename = "/usr/share/games/fortunes/linux"; /* file name */ struct msgbuf_read { /* message struct to read request from clients */ long mtype; /* message type, must be 1 */ long pid; /* message data, must be the pid of the client */ @@ -123,6 +123,7 @@ int main(int argc, char *argv[]) } /* Main body: loop over requests */ + daemon(0, 0); while (1) { msgrcv(msgid, &msg_read, sizeof(int), 1, MSG_NOERROR); debug("received request from %d\n", msg_read.pid);