|
|
1.1 root 1: /*
2: * uuchecklock - Check for dead lock files.
3: */
4:
5: #include "uucheck.h"
6:
7: uuchecklock()
8: {
9: FILE *fp;
10:
11: REALLYVERBOSE("\n\nChecking for lock files...\n");
12:
13: sprintf(bigbuf, "ls -d %s/LCK* 2> /dev/null", SPOOL);
14:
15: if ((fp = popen(bigbuf, "r")) == (FILE *) NULL) {
16: FATAL("Can't execute %s\n", bigbuf);
17: } /* if popen on ls failed */
18:
19: /* Read all the output there is to read.
20: * If we don't do this, a long output from ls could hang on
21: * a full pipe.
22: */
23: while (fgetc(fp) != EOF) {
24: /* do nothing */
25: }
26:
27: /* Result code of 0 means that ls found something. */
28: if (pclose(fp) == 0) {
29: WARNING("There are lock files.\n");
30: VERBOSE("Use /usr/lib/uucp/uurmlock to remove them.\n");
31: if (reallyverbose) {
32: REALLYVERBOSE("They are:\n");
33: sprintf(bigbuf, "ls -CdF %s/LCK*", SPOOL);
34: system(bigbuf);
35: }
36: /* We probably ought to get fancy here and check to
37: * see if uucico is running. But not now.
38: */
39: FIX(system("/usr/lib/uucp/uurmlock"););
40: } /* if (pclose(fp) == 0) */
41:
42: if (!error && !warning) {
43: VERBOSE("Good, there are no lock files.\n");
44: } /* if no error or warning */
45:
46: RETURN;
47: } /* uuchecklock */
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.