summaryrefslogtreecommitdiffstats
path: root/lib/libc/stdio/local.h
diff options
context:
space:
mode:
authorjb <jb@FreeBSD.org>2004-03-09 02:44:59 +0000
committerjb <jb@FreeBSD.org>2004-03-09 02:44:59 +0000
commite9062915d30751c7edfb1855484e1aaeca783ca6 (patch)
tree07a7908410c497b79289bf7098dfa4d4a853ee82 /lib/libc/stdio/local.h
parent39dab43424b65b9203b2cfcb9c017cd0cb383038 (diff)
downloadFreeBSD-src-e9062915d30751c7edfb1855484e1aaeca783ca6.zip
FreeBSD-src-e9062915d30751c7edfb1855484e1aaeca783ca6.tar.gz
On 4.X it was possible for an application to initialise a local FILE
structure and call stdio functions. In 5.X this was broken when FILE locking was introduced into libc. This change makes most (relevant) stdio functions work again when the _extra file in FILE isn't initialised (and can't be without a libc function to do it since the __sFILEX structure is private to libc).
Diffstat (limited to 'lib/libc/stdio/local.h')
-rw-r--r--lib/libc/stdio/local.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/libc/stdio/local.h b/lib/libc/stdio/local.h
index 9e1cad4..2cf2637 100644
--- a/lib/libc/stdio/local.h
+++ b/lib/libc/stdio/local.h
@@ -143,6 +143,6 @@ struct __sFILEX {
* orientation. If o < 0, the stream has byte-orientation.
*/
#define ORIENT(fp, o) do { \
- if ((fp)->_extra->orientation == 0) \
+ if ((fp)->_extra != NULL && (fp)->_extra->orientation == 0) \
(fp)->_extra->orientation = (o); \
} while (0)
OpenPOWER on IntegriCloud