From 8d62ee40dc28d335867f292dd8aab66f53e20b5b Mon Sep 17 00:00:00 2001 From: dhartmei Date: Sat, 14 Sep 2002 22:03:14 +0000 Subject: Move __cleanup into mprotect'ed page to prevent unintentional modifications similar to the atexit handlers. Idea and help deraadt@, ok deraadt@ --- lib/libc/stdio/setvbuf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/libc/stdio/setvbuf.c') diff --git a/lib/libc/stdio/setvbuf.c b/lib/libc/stdio/setvbuf.c index 65501fce9d9..0c6fd8d1623 100644 --- a/lib/libc/stdio/setvbuf.c +++ b/lib/libc/stdio/setvbuf.c @@ -35,7 +35,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: setvbuf.c,v 1.3 2001/07/09 06:57:44 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: setvbuf.c,v 1.4 2002/09/14 22:03:14 dhartmei Exp $"; #endif /* LIBC_SCCS and not lint */ #include @@ -155,7 +155,7 @@ nbf: /* begin/continue reading, or stay in intermediate state */ fp->_w = 0; } - __cleanup = _cleanup; + __atexit_register_cleanup(_cleanup); return (ret); } -- cgit v1.2.3-59-g8ed1b