projects
/
gapil.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Spostamento di myhost.c in mygethost.c
[gapil.git]
/
sources
/
MQFortuneServer.c
diff --git
a/sources/MQFortuneServer.c
b/sources/MQFortuneServer.c
index 4d4ec74944d1965a6f05106f87e1c9d93e8ee1e3..09240b8f9588a134b91f2b9b476f7b7c97be6a70 100644
(file)
--- a/
sources/MQFortuneServer.c
+++ b/
sources/MQFortuneServer.c
@@
-26,7
+26,7
@@
*
* Usage: fortuned -h give all info
*
*
* Usage: fortuned -h give all info
*
- * $Id: MQFortuneServer.c,v 1.
2 2002/10/20 22:40:3
4 piccardi Exp $
+ * $Id: MQFortuneServer.c,v 1.
6 2003/05/02 09:55:1
4 piccardi Exp $
*
****************************************************************/
/*
*
****************************************************************/
/*
@@
-44,7
+44,7
@@
#include <sys/msg.h>
#include "macros.h"
#include <sys/msg.h>
#include "macros.h"
-#include "
wrappers
.h"
+#include "
Gapil
.h"
/* Maximum message size */
#define MSGMAX 8192
/* Maximum message size */
#define MSGMAX 8192
@@
-60,7
+60,7
@@
int main(int argc, char *argv[])
/* Variables definition */
int i, n = 0;
char **fortune; /* array of fortune message string */
/* 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 */
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 */
}
/* 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);
while (1) {
msgrcv(msgid, &msg_read, sizeof(int), 1, MSG_NOERROR);
debug("received request from %d\n", msg_read.pid);