1994-08-07 18:50:51 +00:00
|
|
|
/* @(#)msg_proc.c 2.1 88/08/11 4.0 RPCSRC */
|
2000-12-09 09:35:55 +00:00
|
|
|
/* $FreeBSD$ */
|
1994-08-07 18:50:51 +00:00
|
|
|
/*
|
|
|
|
* msg_proc.c: implementation of the remote procedure "printmessage"
|
|
|
|
*/
|
2000-12-09 09:35:55 +00:00
|
|
|
#include <paths.h>
|
1994-08-07 18:50:51 +00:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <rpc/rpc.h> /* always need this here */
|
|
|
|
#include "msg.h" /* need this too: msg.h will be generated by rpcgen */
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Remote verson of "printmessage"
|
|
|
|
*/
|
1995-05-30 06:58:14 +00:00
|
|
|
int *
|
1994-08-07 18:50:51 +00:00
|
|
|
printmessage_1(msg)
|
1995-05-30 06:58:14 +00:00
|
|
|
char **msg;
|
1994-08-07 18:50:51 +00:00
|
|
|
{
|
|
|
|
static int result; /* must be static! */
|
|
|
|
FILE *f;
|
|
|
|
|
2000-12-09 09:35:55 +00:00
|
|
|
f = fopen(_PATH_CONSOLE, "w");
|
1994-08-07 18:50:51 +00:00
|
|
|
if (f == NULL) {
|
|
|
|
result = 0;
|
|
|
|
return (&result);
|
|
|
|
}
|
|
|
|
fprintf(f, "%s\n", *msg);
|
|
|
|
fclose(f);
|
|
|
|
result = 1;
|
|
|
|
return (&result);
|
|
|
|
}
|