diff options
| author | John Birrell <jb@FreeBSD.org> | 2004-03-09 04:51:58 +0000 |
|---|---|---|
| committer | John Birrell <jb@FreeBSD.org> | 2004-03-09 04:51:58 +0000 |
| commit | 44fce14365cd2e9b9b2575fdf1b2eb21c984765d (patch) | |
| tree | d8afb4ad13d20afe3d08e02e936f32023a514304 /lib/libc/stdio | |
| parent | 618c18c7c3c6f8f5a0595a6086c06bb2f5f9b00f (diff) | |
Notes
Diffstat (limited to 'lib/libc/stdio')
| -rw-r--r-- | lib/libc/stdio/_flock_stub.c | 12 | ||||
| -rw-r--r-- | lib/libc/stdio/local.h | 2 |
2 files changed, 4 insertions, 10 deletions
diff --git a/lib/libc/stdio/_flock_stub.c b/lib/libc/stdio/_flock_stub.c index 1b79ce22719d..8abc8e3b6384 100644 --- a/lib/libc/stdio/_flock_stub.c +++ b/lib/libc/stdio/_flock_stub.c @@ -73,9 +73,7 @@ _flockfile(FILE *fp) { pthread_t curthread = _pthread_self(); - if (fp->_lock == NULL) { - } - else if (fp->_lock->fl_owner == curthread) + if (fp->_lock->fl_owner == curthread) fp->_lock->fl_count++; else { /* @@ -103,9 +101,7 @@ _ftrylockfile(FILE *fp) pthread_t curthread = _pthread_self(); int ret = 0; - if (fp->_lock == NULL) { - } - else if (fp->_lock->fl_owner == curthread) + if (fp->_lock->fl_owner == curthread) fp->_lock->fl_count++; /* * Make sure this mutex is treated as a private @@ -125,12 +121,10 @@ _funlockfile(FILE *fp) { pthread_t curthread = _pthread_self(); - if (fp->_lock == NULL) { - } /* * Check if this file is owned by the current thread: */ - else if (fp->_lock->fl_owner == curthread) { + if (fp->_lock->fl_owner == curthread) { /* * Check if this thread has locked the FILE * more than once: diff --git a/lib/libc/stdio/local.h b/lib/libc/stdio/local.h index 2cf2637a8e10..9e1cad44a536 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 != NULL && (fp)->_extra->orientation == 0) \ + if ((fp)->_extra->orientation == 0) \ (fp)->_extra->orientation = (o); \ } while (0) |
