File:  [MW Coherent from dump] / coherent / a / usr / bob / uusrc / src / uutouch.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

/*
 *  uutouch.c
 *
 *  Force a command file to the given site which will trigger the need
 *  for a call the next "uucico -sany".
 */

#include <stdio.h>
#include "dcp.h"

extern	int optopt, optind;
char	ctlfil[BUFSIZ];

main(argc, argv)
int argc;
char *argv[];
{
	int ch, fd, error=0;
	char *arg;

	while ( (ch=getopt(argc, argv, "vV")) != EOF ) {
		switch (ch) {
		case 'v':
		case 'V':
			fatal("uutouch: Version %s", VERSION);
		default:
			fatal("Improper option usage: %c", optopt);
		}
	}
	for (;optind<argc; optind++) {
		arg = argv[optind];
		if ( !knowhost(arg) ) {
			nonfatal("Host \"%s\" unknown", arg);
			error++;
		} else {
			sprintf(ctlfil, "%s/%s", SPOOLDIR, arg);
			if ( !ckdir(ctlfil) ) {
				nonfatal("Unable to create directory: %s",
								ctlfil);
				error++;
				continue;
			}
			sprintf(ctlfil, "%s/%s/C.%.*s0", SPOOLDIR, arg,
							SITESIG, arg);
			if ( (fd=creat(ctlfil, 0600)) < 0 ) {
				nonfatal("Unable to create file: %s", ctlfil);
				error++;
			} else
				close(fd);
		}
	}
	exit(error);
}


unix.superglobalmegacorp.com

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