diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2004-08-20 17:40:35 +0400 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2004-08-20 17:40:35 +0400 |
commit | 7c4817127924c875900d7f79e547746f7df645d2 (patch) | |
tree | 82eed21baea199207d48aa4d2990769d623be760 /winsup | |
parent | b9188d6c1e235ddee9c38f7ed0524853cec097d8 (diff) |
* fhandler_tape.cc (fhandler_dev_tape::raw_read): Use ?: instead of
if/else.
(fhandler_dev_tape::raw_write): Return -1 in case of error.
Diffstat (limited to 'winsup')
-rw-r--r-- | winsup/cygwin/ChangeLog | 6 | ||||
-rw-r--r-- | winsup/cygwin/fhandler_tape.cc | 7 |
2 files changed, 8 insertions, 5 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index c14c12ec6..03fcb33c6 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,9 @@ +2004-08-20 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_tape.cc (fhandler_dev_tape::raw_read): Use ?: instead of + if/else. + (fhandler_dev_tape::raw_write): Return -1 in case of error. + 2004-08-19 Corinna Vinschen <corinna@vinschen.de> * errno.cc (_sys_errlist): Change various text to their english Linux diff --git a/winsup/cygwin/fhandler_tape.cc b/winsup/cygwin/fhandler_tape.cc index 1e31ee1b0..c86b0f400 100644 --- a/winsup/cygwin/fhandler_tape.cc +++ b/winsup/cygwin/fhandler_tape.cc @@ -1350,10 +1350,7 @@ fhandler_dev_tape::raw_read (void *ptr, size_t &ulen) lastblk_to_read (true); } } - if (ret) - ulen = (size_t) -1; - else - ulen = bytes_read; + ulen = (ret ? (size_t) -1 : bytes_read); unlock (); } @@ -1366,7 +1363,7 @@ fhandler_dev_tape::raw_write (const void *ptr, size_t len) int ret = mt->drive (driveno ())->write (get_handle (), mt_evt, ptr, len); if (ret) __seterrno_from_win_error (ret); - return unlock (len); + return unlock (ret ? -1 : (int) len); } _off64_t |