|
|
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: #define SPOOLDIR "/usr/spool/uucp" ! 12: #define SITESIG 8 ! 13: #define VERSION "COHERENT-Taylor 1.04" ! 14: ! 15: extern int optopt, optind; ! 16: char ctlfil[BUFSIZ]; ! 17: ! 18: main(argc, argv) ! 19: int argc; ! 20: char *argv[]; ! 21: { ! 22: int ch, fd, error=0; ! 23: char *arg; ! 24: ! 25: while ( (ch=getopt(argc, argv, "vV")) != EOF ) { ! 26: switch (ch) { ! 27: case 'v': ! 28: case 'V': ! 29: fatal("uutouch: Version %s", VERSION); ! 30: default: ! 31: fatal("Improper option usage: %c", ch); ! 32: exit(1); ! 33: } ! 34: } ! 35: for (;optind<argc; optind++) { ! 36: arg = argv[optind]; ! 37: #ifdef TAYLOR_UUCP ! 38: if ( !check_sys_file(arg) ) { ! 39: printf("Host \"%s\" unknown\n", arg); ! 40: #else ! 41: if ( !knowhost(arg) ) { ! 42: nonfatal("Host \"%s\" unknown", arg); ! 43: #endif ! 44: error++; ! 45: } else { ! 46: sprintf(ctlfil, "%s/%s", SPOOLDIR, arg); ! 47: #ifndef TAYLOR_UUCP ! 48: if ( !ckdir(ctlfil) ) { ! 49: nonfatal("Unable to create directory: %s", ! 50: ctlfil); ! 51: error++; ! 52: continue; ! 53: } ! 54: #endif ! 55: sprintf(ctlfil, "%s/%s/C.%.*s0%.4d", SPOOLDIR, arg, ! 56: SITESIG, arg, getpid()); ! 57: if ( (fd=creat(ctlfil, 0600)) < 0 ) { ! 58: #ifdef TAYLOR_UUCP ! 59: printf("Unable to create file: %s\n", ctlfil); ! 60: #else ! 61: nonfatal("Unable to create file: %s", ctlfil); ! 62: #endif ! 63: error++; ! 64: } else ! 65: close(fd); ! 66: } ! 67: } ! 68: exit(error); ! 69: } ! 70:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.