|
|
1.1 ! root 1: /* ! 2: * uutouch.c ! 3: * ! 4: * Force a command file to the given site which will trigger the need ! 5: * for a call the next "uucico -sany". ! 6: */ ! 7: ! 8: #include <stdio.h> ! 9: #include "dcp.h" ! 10: ! 11: extern int optopt, optind; ! 12: char ctlfil[BUFSIZ]; ! 13: ! 14: main(argc, argv) ! 15: int argc; ! 16: char *argv[]; ! 17: { ! 18: int ch, fd, error=0; ! 19: char *arg; ! 20: ! 21: while ( (ch=getopt(argc, argv, "vV")) != EOF ) { ! 22: switch (ch) { ! 23: case 'v': ! 24: case 'V': ! 25: fatal("uutouch: Version %s", VERSION); ! 26: default: ! 27: fatal("Improper option usage: %c", optopt); ! 28: } ! 29: } ! 30: for (;optind<argc; optind++) { ! 31: arg = argv[optind]; ! 32: if ( !knowhost(arg) ) { ! 33: nonfatal("Host \"%s\" unknown", arg); ! 34: error++; ! 35: } else { ! 36: sprintf(ctlfil, "%s/%s", SPOOLDIR, arg); ! 37: if ( !ckdir(ctlfil) ) { ! 38: nonfatal("Unable to create directory: %s", ! 39: ctlfil); ! 40: error++; ! 41: continue; ! 42: } ! 43: sprintf(ctlfil, "%s/%s/C.%.*s0", SPOOLDIR, arg, ! 44: SITESIG, arg); ! 45: if ( (fd=creat(ctlfil, 0600)) < 0 ) { ! 46: nonfatal("Unable to create file: %s", ctlfil); ! 47: error++; ! 48: } else ! 49: close(fd); ! 50: } ! 51: } ! 52: exit(error); ! 53: } ! 54:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.