mirror of
https://github.com/adtools/clib2.git
synced 2025-12-08 14:59:05 +00:00
- Reworked the __putc() and putc() macros to reference the 'c' input
parameter only once, and to be free of side-effects when tinkering with the buffer position. - isatty() had the __fd_lock() call in the wrong place, which could have led to cleanup problems later. - The close action in the stdio, socket and termios hook code now also zaps the fd pointer itself after cleaning up the file descriptor table entry. git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@15211 87f5fb63-7c3d-0410-a384-fd976d0f7a62
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: stdio.h,v 1.23 2010-10-19 09:35:16 obarthel Exp $
|
||||
* $Id: stdio.h,v 1.24 2010-10-20 13:12:59 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -285,11 +285,11 @@ extern char *tmpnam(char *buf);
|
||||
(((((FILE *)(f))->flags & (__FILE_IN_USE|__FILE_WRITABLE)) == (__FILE_IN_USE|__FILE_WRITABLE) && \
|
||||
(((FILE *)(f))->flags & __FILE_BUFFER_MASK) != _IONBF && \
|
||||
(((FILE *)(f))->num_write_bytes < ((FILE *)(f))->size)) ? \
|
||||
(((FILE *)(f))->buffer[((FILE *)(f))->num_write_bytes++] = (c), \
|
||||
(((FILE *)(f))->buffer[((FILE *)(f))->num_write_bytes] = (c), \
|
||||
(((((FILE *)(f))->flags & __FILE_BUFFER_MASK) == _IOLBF && \
|
||||
(c) == '\n') ? \
|
||||
__flush(f) : \
|
||||
(c))) : \
|
||||
((FILE *)(f))->buffer[((FILE *)(f))->num_write_bytes] == '\n') ? \
|
||||
((FILE *)(f))->num_write_bytes++, __flush(f) : \
|
||||
((FILE *)(f))->buffer[((FILE *)(f))->num_write_bytes++])) : \
|
||||
fputc((c),(f)))
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
Reference in New Issue
Block a user