From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10d4db,1b8aa1cbaadb6c7d,start X-Google-Attributes: gid10d4db,public X-Google-ArrivalTime: 1994-01-18 17:18:01 PST Path: gmd.de!xlink.net!scsing.switch.ch!swidir.switch.ch!univ-lyon1.fr!zaphod.crihan.fr!warwick!doc.ic.ac.uk!daresbury!keele!uknet!EU.net!news.funet.fi!klaava!klaava!not-for-mail From: gleasokr@refuge.Colorado.EDU (Kris Gleason) Newsgroups: comp.os.linux.announce Subject: Patch to getty_ps2.0.7b for linux 0.99.15 Followup-To: comp.os.linux.misc Date: 18 Jan 1994 22:22:37 +0200 Organization: University of Colorado at Boulder Sender: wirzeniu@klaava.Helsinki.FI Message-ID: <2hhged$3rb@klaava.Helsinki.FI> NNTP-Posting-Host: klaava.helsinki.fi Keywords: getty_ps, Linux 0.99.15, patch getty_ps 2.0.7c ------------------- The upcoming release of 0.99.15 will break getty_ps version 2.0.7b. If you are using this package, please apply the following patch to your sources, and recompile your binaries. This patch will bring your sources up to version 2.0.7c. The patches fix a vhangup() bug that has gone unnoticed for nearly a year. They also support EAGAIN returned from open() as per the new version of the serial driver. This release does not address any other problems with getty_ps. It is provided to allow compatibility with the new kernel. A new release of getty_ps is in the works. The new release will support receiving faxes, logging via syslog, a few other new features, and lots of bug fixes. It should be out in a month or so. Kris Gleason gleasokr@boulder.colorado.edu -- Enclosed File: diff-207b-207c; sum reports: 28831 3 BEGIN-----------8<---------CUT HERE---------8<--------------- *** ../getty_ps2.0.7b/main.c Tue Apr 20 16:51:44 1993 --- main.c Mon Jan 10 22:01:53 1994 *************** *** 495,500 **** --- 495,528 ---- #endif /* LOGUTMP */ + /* vhangup() goes _here_ not where it was + */ + + debug3(D_RUN, "calling vhangup() on %s\n", devname); + while ((fd = open(devname, O_RDWR | O_NDELAY)) < 0) { + if(errno == EBUSY) + sleep(30); + else if(errno != EAGAIN) { + logerr("couldn't open line to vhangup"); + exit(FAIL); + } + } + ioctl(fd, TIOCSCTTY, 1); + gtab = gtabvalue(GtabId, G_FORCE); + if(! NoHangUp) { + (void) ioctl(STDIN, TCGETS, &termio); + termio.c_cflag &= ~CBAUD; + termio.c_cflag |= B0; + (void) ioctl(STDIN, TCSETSF, &termio); + sleep(2); + } + settermio(&(gtab->itermio), INITIAL); + ioctl(fd, TCSETS, &termio); + signal(SIGHUP, SIG_IGN); + vhangup(); + signal(SIGHUP, shangup); + close(fd); + /* now, the init device is opened ONLY if INIT or WAITCHAR is requested */ *************** *** 501,511 **** if((init) || (waitchar)) { debug3(D_RUN, "opening init line: %s\n", initdevname); ! while(((fd = open(initdevname, O_RDWR | O_NDELAY)) < 0) && ! (errno == EBUSY)) sleep(30); ! if(fd < 0) { ! logerr("cannot open init line"); ! exit(FAIL); } if(fd != 0) { logerr("cannot open init stdin"); --- 529,541 ---- if((init) || (waitchar)) { debug3(D_RUN, "opening init line: %s\n", initdevname); ! while((fd = open(initdevname, O_RDWR | O_NDELAY)) < 0) { ! if(errno == EBUSY) ! sleep(30); ! else if(errno != EAGAIN) { ! logerr("cannot open init line"); ! exit(FAIL); ! } } if(fd != 0) { logerr("cannot open init stdin"); *************** *** 524,538 **** setbuf(stdout, (char *) NULL); setbuf(stderr, (char *) NULL); - gtab = gtabvalue(GtabId, G_FORCE); - if(! NoHangUp) { - (void) ioctl(STDIN, TCGETS, &termio); - termio.c_cflag &= ~CBAUD; - termio.c_cflag |= B0; - (void) ioctl(STDIN, TCSETSF, &termio); - sleep(2); - } - settermio(&(gtab->itermio), INITIAL); flags = fcntl(STDIN, F_GETFL, 0); (void) fcntl(STDIN, F_SETFL, flags & ~O_NDELAY); --- 554,559 ---- *************** *** 698,707 **** debug3(D_RUN, "opening line: %s\n", devname); if((fd = open(devname, (waitfor) ? ! (O_RDWR | O_NDELAY) : (O_RDWR))) < 0) { ! logerr("cannot open connect line"); ! exit(FAIL); ! } if(fd != 0) { logerr("cannot open connect stdin"); exit(FAIL); --- 719,731 ---- debug3(D_RUN, "opening line: %s\n", devname); if((fd = open(devname, (waitfor) ? ! (O_RDWR | O_NDELAY) : (O_RDWR))) < 0) ! if(errno == EAGAIN) ! exit(0); ! else { ! logerr("cannot open connect line"); ! exit(FAIL); ! } if(fd != 0) { logerr("cannot open connect stdin"); exit(FAIL); *************** *** 714,719 **** --- 738,745 ---- logerr("cannot open connect stderr"); exit(FAIL); } + + ioctl(fd, TIOCSCTTY, 1); #ifdef UUGETTY /* stop looking for lockfiles now END-------------8<---------CUT HERE---------8<--------------- -- Mail submissions for comp.os.linux.announce to: linux-announce@tc.cornell.edu PLEASE remember Keywords: and a short description of the software.