#ifndef lint
-static char sccsid[] = "@(#)uupoll.c 5.1 (Berkeley) 7/2/83";
+static char sccsid[] = "@(#)uupoll.c 5.5 (Berkeley) 10/9/85";
#endif
/*
#include "uucp.h"
+int TransferSucceeded = 1;
+struct timeb Now;
+
main(argc, argv)
register int argc;
register char **argv;
{
+ int ret;
+ char wrkpre[MAXFULLNAME];
+ char file[MAXFULLNAME];
+ char grade = 'A';
+ int nocall = 0;
+
if (argc < 2) {
- fprintf(stderr, "usage: uupoll system ...\n");
+ fprintf(stderr, "usage: uupoll [-gX] [-n] system ...\n");
cleanup(1);
}
- chdir(Spool);
+ ret = chdir(Spool);
+ ASSERT(ret >= 0, "CHDIR FAILED", Spool, ret);
strcpy(Progname, "uupoll");
uucpname(Myname);
fprintf(stderr, "This *is* %s!\n", Myname);
continue;
}
+ if (strncmp(argv[0],"-g",2) == SAME) {
+ grade = argv[0][2];
+ continue;
+ }
+ if (strcmp(argv[0],"-n") == SAME) {
+ nocall++;
+ continue;
+ }
- if (versys(argv[0])) {
+ if (versys(&argv[0])) {
fprintf(stderr, "%s: unknown system.\n", argv[0]);
continue;
}
/* Remove any STST file that might stop the poll */
- rmstat(argv[0]);
+ sprintf(wrkpre, "%s/LCK..%.*s", LOCKDIR, MAXBASENAME, argv[0]);
+ if (access(wrkpre, 0) < 0)
+ rmstat(argv[0]);
+ sprintf(wrkpre, "%c.%.*s", CMDPRE, SYSNSIZE, argv[0]);
+ if (!iswrk(file, "chk", Spool, wrkpre)) {
+ sprintf(file, "%s/%c.%.*s%cPOLL", subdir(Spool, CMDPRE),
+ CMDPRE, SYSNSIZE, argv[0], grade);
+ close(creat(file, 0666));
+ }
/* Attempt the call */
- xuucico(argv[0]);
+ if (!nocall)
+ xuucico(argv[0]);
}
cleanup(0);
}