11905Swollman/* @(#)msg_proc.c	2.1 88/08/11 4.0 RPCSRC */
269793Sobrien/* $FreeBSD$ */
31905Swollman/*
41905Swollman * msg_proc.c: implementation of the remote procedure "printmessage"
51905Swollman */
669793Sobrien#include <paths.h>
71905Swollman#include <stdio.h>
81905Swollman#include <rpc/rpc.h>	/* always need this here */
91905Swollman#include "msg.h"	/* need this too: msg.h will be generated by rpcgen */
101905Swollman
111905Swollman/*
121905Swollman * Remote verson of "printmessage"
131905Swollman */
148875Srgrimesint *
151905Swollmanprintmessage_1(msg)
168875Srgrimes	char **msg;
171905Swollman{
181905Swollman	static int result; /* must be static! */
191905Swollman	FILE *f;
201905Swollman
2169793Sobrien	f = fopen(_PATH_CONSOLE, "w");
221905Swollman	if (f == NULL) {
231905Swollman		result = 0;
241905Swollman		return (&result);
251905Swollman	}
261905Swollman	fprintf(f, "%s\n", *msg);
271905Swollman	fclose(f);
281905Swollman	result = 1;
291905Swollman	return (&result);
301905Swollman}
31