Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!cronkite!newstop!jethro!gakbox!gak From: gak@gakbox.Corp.Sun.COM (Richard Stueven) Newsgroups: comp.sys.3b1 Subject: Re: CONN FAILED (DEVICE LOCKED) - HDB Message-ID: <4474@jethro.Corp.Sun.COM> Date: 20 Jun 91 20:28:05 GMT References: <455.28605DC6@mcws.fidonet.org> Sender: news@jethro.Corp.Sun.COM Reply-To: gak@gakbox.Corp.Sun.COM (Richard Stueven) Organization: Sun Microsystems, Mtn. View, CA Lines: 52 In article <455.28605DC6@mcws.fidonet.org>, BHeess@mcws.fidonet.org (Brian Heess) writes: |> |> uucp mcws (6/19-23:24:52,99,0) CONN FAILED (DEVICE LOCKED) I've seen this happen a lot. When an incoming call disconnects, often the lock file does not get removed. I wrote a small program, "uuunlock.c", that validates the lock file(s) and removes them if they're invalid. Since it's a short program, I'll include it here rather than posting to the source group. ============================================================================== #include #include char *ulockf[] = { "/usr/spool/uucp/LCK..ph1" }; #define NULOCKF 1 main(argc,argv) int argc; char **argv; { int i, fd; long uucppid; char errbuff[512]; for (i = 0; i < NULOCKF; i++) { if ((fd = open(ulockf[i],O_RDONLY)) == -1) { sprintf(errbuff,"Can't open %s",ulockf[i]); perror(errbuff); } else if (read(fd,&uucppid,sizeof(uucppid)) == -1) { perror("read error"); } else { close(fd); if (kill((int)uucppid,0) == -1) { if (unlink(ulockf[i]) == -1) { sprintf(errbuff,"Can't unlink %s",ulockf[i]); perror(errbuff); } } else { sprintf(errbuff,"kill -0 %d failed",(int)uucppid); perror(errbuff); } } } } ================================================================================ -- I guess there's some things | Seems like the more I think I know I'm not meant to understand | The more I find I don't Ain't life a riot? Ain't love grand? | Every answer opens up so many questions Richard Stueven gak@Corp.Sun.COM ...!attmail!gak