remove truely atrocious use of FILE internals.

If you don't want fclose(f) to flush the file, just close the
underlying file descriptor, then fclose() doesn't have anything to
hang upon.
This commit is contained in:
espie 2005-04-21 10:47:37 +00:00
parent 0e6e6a6644
commit 357f6e3acb
3 changed files with 43 additions and 13 deletions

View File

@ -1,11 +1,13 @@
# $OpenBSD: Makefile,v 1.14 2004/12/20 10:35:35 alek Exp $
# $OpenBSD: Makefile,v 1.15 2005/04/21 10:47:37 espie Exp $
COMMENT= "log out idle users and those hogging resources"
DISTNAME= idled-1.16
PKGNAME= ${DISTNAME}p0
CATEGORIES= sysutils
MASTER_SITES= http://www.darkwing.com/idled/download/ \
ftp://ftp.cs.hope.edu/pub/idled/
HOMEPAGE= http://www.darkwing.com/idled/
FAKE_FLAGS= PREFIX=${PREFIX} DESTDIR=${WRKINST}

View File

@ -1,6 +1,6 @@
$OpenBSD: patch-Makefile,v 1.1 2001/06/14 03:18:28 pvalchev Exp $
--- Makefile.orig Thu May 16 16:05:28 1996
+++ Makefile Tue Jun 12 19:44:17 2001
$OpenBSD: patch-Makefile,v 1.2 2005/04/21 10:47:37 espie Exp $
--- Makefile.orig Fri May 17 00:05:28 1996
+++ Makefile Wed Apr 20 11:57:59 2005
@@ -2,7 +2,6 @@
#
@ -41,15 +41,14 @@ $OpenBSD: patch-Makefile,v 1.1 2001/06/14 03:18:28 pvalchev Exp $
-DEFS += -DSYSV -DHAVE_PROC_FS -DUTMPPID -DHAVE_SETSID -DHAVE_UTMPX -DUTMPHOST -DRUDEKILL
-SPECLIBS =
-INSTTYPE = install3
-
+#DEFS += -DSYSV -DHAVE_PROC_FS -DUTMPPID -DHAVE_SETSID -DHAVE_UTMPX -DUTMPHOST -DRUDEKILL
+#SPECLIBS =
+#INSTTYPE = install3
-DEST = /usr/local/bin
-CFDEST = /usr/local/lib
-MDEST = /usr/local/man
-LOGDEST = /var/log
+#DEFS += -DSYSV -DHAVE_PROC_FS -DUTMPPID -DHAVE_SETSID -DHAVE_UTMPX -DUTMPHOST -DRUDEKILL
+#SPECLIBS =
+#INSTTYPE = install3
+
+#DEST = /usr/local/bin
+#CFDEST = /usr/local/lib
+#MDEST = /usr/local/man
@ -90,14 +89,14 @@ $OpenBSD: patch-Makefile,v 1.1 2001/06/14 03:18:28 pvalchev Exp $
+ ${BSD_INSTALL_DATA} ${COMMFILE}.template ${CFDEST}
+ ${BSD_INSTALL_MAN} ${CFMAN} ${MDEST}/man5
+ ${BSD_INSTALL_MAN} ${PMAN} ${MDEST}/man8
+ @echo ""
+ @echo "*** Be sure to edit/create the file ${CONFIG} based on"
+ @echo "*** the needs for your system. The ${CFLIB}/${COMMFILE}.template"
+ @echo "*** file can serve as a guide, as well as the man pages."
@echo ""
- @echo "Be sure to edit/create the file ${CONFIG} based on"
- @echo "the needs for your system. The ${CONFIG}.template"
- @echo "file can serve as a guide, as well as the man pages."
+ @echo "*** Be sure to edit/create the file ${CONFIG} based on"
+ @echo "*** the needs for your system. The ${CFLIB}/${COMMFILE}.template"
+ @echo "*** file can serve as a guide, as well as the man pages."
+ @echo ""
# Aix Prefers install2
install2: all

View File

@ -0,0 +1,29 @@
$OpenBSD: patch-warn_c,v 1.1 2005/04/21 10:47:37 espie Exp $
--- warn.c.orig Thu Apr 21 12:43:40 2005
+++ warn.c Thu Apr 21 12:45:48 2005
@@ -139,24 +139,7 @@ void warn(i, type, do_msg)
{
if (opened)
{
- /* Prevent the close from flushing unwritten data, since that is
- * probably the block that caused us to get here in the first
- * place. This probably isn't very portable, but I can't find
- * any other method that works (barring changing all the output
- * here to use a simple file descriptor instead of a FILE *).
- * Linux is the only system I have seen that doesn't have the
- * _ptr and _base. Let me know if there are others, or if you
- * have a system independant way to fix it!
- */
-#if defined(__linux__)
- termf->_IO_read_ptr = termf->_IO_read_base;
- termf->_IO_write_ptr = termf->_IO_write_base;
-#elif defined(BSDI) || defined(BSD_OS2)
- termf->_p = (termf->_ub)._base;
-#else
- termf->_ptr = termf->_base;
-#endif
- (void) fclose (termf);
+ close (fileno(termf));
}
exit (0);