PMDF vs. 4.3BSD

1 view
Skip to first unread message

Gene Spafford

unread,
Oct 3, 1986, 12:00:59 PM10/3/86
to
If any of you are running PMDF II (as many CSNet sites are), you will
discover that PMDF will not work once you convert to 4.3BSD. It works
a little, but keeps timing out and your queue keeps growing.

Well, after a few dead-ends, we found the problem. The following
changes should be made to your PMDF code and then the whole
package should be recompiled and relinked.

Mark Johnson
Gene Spafford
postmasters at GaTech


*** osc.c.orig Wed Oct 1 10:41:55 1986
--- osc.c Wed Oct 1 10:59:44 1986
***************
*** 10,15 ****
--- 10,16 ----
#include <stdio.h>
#include <fcntl.h>
#include <sgtty.h>
+ #include <sys/types.h>
#include "pcvars.h" /* excerpt from h00vars.h */

#define R_OK 4
***************
*** 236,248 ****

register int r;
struct timeval timeout;
! int readfs;

timeout.tv_sec = timelimit;
timeout.tv_usec = 0;
! readfs = 1;
! select(1,&readfs,0,0,&timeout);
! if (readfs == 0) return(0);
r = read(fileno(stdin),ch,1);
(*ch) &= 0x7f;
if (r < 0) return(-errno);
--- 237,251 ----

register int r;
struct timeval timeout;
! int s_result;
! fd_set readfs;

timeout.tv_sec = timelimit;
timeout.tv_usec = 0;
! FD_ZERO(&readfs);
! FD_SET(0, &readfs);
! s_result = select(1,&readfs,0,0,&timeout);
! if (s_result <= 0 || !FD_ISSET(0, &readfs)) return(0);
r = read(fileno(stdin),ch,1);
(*ch) &= 0x7f;
if (r < 0) return(-errno);
***************
*** 257,269 ****

{
struct timeval timeout;
! int readfs;

timeout.tv_sec = timelimit;
timeout.tv_usec = 0;
! readfs = 1;
! select(1,&readfs,0,0,&timeout);
! if (readfs == 0) return(0);
gets(packet->body, sizeof packet->body);
if ferror(stdin) {
clearerr(stdin);
--- 260,274 ----

{
struct timeval timeout;
! int s_result;
! fd_set readfs;

timeout.tv_sec = timelimit;
timeout.tv_usec = 0;
! FD_ZERO(&readfs);
! FD_SET(0, &readfs);
! s_result = select(1,&readfs,0,0,&timeout);
! if (s_result <= 0 || !FD_ISSET(0, &readfs)) return(0);
gets(packet->body, sizeof packet->body);
if ferror(stdin) {
clearerr(stdin);

Reply all
Reply to author
Forward
0 new messages