#ifndef lint
static char sccsid[] = "@(#)rfsboot.c	1.2 (UKC) 23/9/86";
#endif  lint
/* Rfsboot
 * This is what replies to the request from another machine for a (say) rpcsrv.
 * It is kicked off by srv from /etc/ringsrv/{name of program required}
 * with a tsb port connected to file descriptor 0
 * The remotely executing program inherits this.
 */
#include <stdio.h>
#include <sys/tsbsp.h>
#include <sys/tserrno.h>
#include "trans.h"
#include "config.h"

#define tsfd 0

char mesg[64];		/* for error messages */

char rpcsrv[] = RPCSRV;

main(Argc,Argv)
char **Argv;
{
	register char **argv, **envp;

	/* Error messages into log files */
	(void) freopen("/tmp/stdout","a",stdout);
	(void) freopen("/tmp/stderr","a",stderr);
	setbuf(stdout, (char *) NULL); /* unbuffered */
	setbuf(stderr, (char *) NULL); /* unbuffered */

	execl(rpcsrv,"rpcsrv","0", 0);

	rpcfail(tsfd,sprintf(mesg, "%s: Cannot exec \"%s\"\n", Argv[0], rpcsrv), stderr);
}
