$NetBSD: patch-ag,v 1.2 2000/08/05 07:31:20 jlam Exp $ --- apcserial.c.orig Thu Jul 29 04:47:46 1999 +++ apcserial.c Sat Aug 5 02:52:40 2000 @@ -134,10 +134,10 @@ newtio.c_oflag = 0; /* Raw output */ newtio.c_lflag = 0; /* No local echo */ -#ifdef __freebsd__ +#if defined(__freebsd__) || defined (__NetBSD__) newtio.c_ispeed = DEFAULT_SPEED; /* Set input speed */ newtio.c_ospeed = DEFAULT_SPEED; /* Set output speed */ -#endif /* __freebsd__ */ +#endif /* __freebsd__ || __NetBSD__ */ /* w.p. This makes a non.blocking read() with 5 sec. timeout */ newtio.c_cc[VMIN] = 0; @@ -206,7 +206,6 @@ { char response[32]; /* w.p. */ char a; - FILE *pwdf; int errflag = 0; response[0] = '\0'; @@ -242,19 +241,6 @@ } } } - if ((((pwdf = fopen(PWRFAIL, "r" )) == NULL) && - (ups->mode.type != BK)) || - (((pwdf = fopen(PWRFAIL, "r" )) == NULL) && - (ups->LineUp != 0) && (ups->mode.type == BK))) { - fprintf(stderr, - "%s: Attempting to kill the power!\n" \ - "%s: Nice TRY but not TODAY!\n" \ - "%s: Shutdown not called first.\n" \ - "%s: Bug found by Tom Kunicki\n", - ups->argvalue, ups->argvalue, - ups->argvalue, ups->argvalue); - terminate(0); - } else { errflag=0; /* w.p. */ if ((ups->class.type == SHAREMASTER) || (ups->class.type == SHARENETMASTER)) { @@ -271,7 +257,6 @@ ups->argvalue); sleep(15); } - fclose(pwdf); fprintf(stderr, "%s: Attempting to kill the power!\n", @@ -420,9 +405,7 @@ } } /* w.p. */ - sleep(10); terminate(0); - } } else { if (ups->mode.type <= SHAREBASIC) { switch(ups->cable.type) {