File:  [MW Coherent from dump] / coherent / a / usr / bob / uusrc / junk / ping.c
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Wed May 29 04:56:34 2019 UTC (7 years ago) by root
Branches: MarkWilliams, MAIN
CVS tags: relic, HEAD
coherent

#include <stdio.h>
#include <signal.h>
FILE	*fmp;
FILE	*fp;
char	bigargs[1024];
char	exarg[BUFSIZ];
main(argc, argv)
int	argc;
char	**argv;
{
	char	*arg;
	int	retval;
	int	c;
	int	count;

	retval = atoi(argv[1]);
	(void) signal(SIGPIPE, SIG_IGN);
	strcpy(bigargs, "mail wgl ");
	if ((fmp = popen(bigargs, "w")) == NULL)
		exit(-1);
	fprintf(fmp, "Ping says: ");
	count = 1;
	while ((arg = *argv++) != NULL) {
		fprintf(fmp, "[%s]:\n ", arg);
		if (count++ > 1) {
			if ((fp = fopen(arg, "r")) == NULL)
				fprintf(fmp, "unable to open %s\n", arg);
			else {
				while ((c = getc(fp)) != EOF)
					putc(c, fmp);
				fclose(fp);
			}
		} else
			fprintf(fmp, "\n");
	}
	fprintf(fmp, "\n\n");
	exit(pclose(fmp) | retval);
}

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.