aboutsummaryrefslogtreecommitdiff
path: root/winsup/cygwin/fhandler_tape.cc
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2004-08-20 13:40:35 +0000
committerCorinna Vinschen <corinna@vinschen.de>2004-08-20 13:40:35 +0000
commit7c4817127924c875900d7f79e547746f7df645d2 (patch)
tree82eed21baea199207d48aa4d2990769d623be760 /winsup/cygwin/fhandler_tape.cc
parentb9188d6c1e235ddee9c38f7ed0524853cec097d8 (diff)
downloadnewlib-7c4817127924c875900d7f79e547746f7df645d2.zip
newlib-7c4817127924c875900d7f79e547746f7df645d2.tar.gz
newlib-7c4817127924c875900d7f79e547746f7df645d2.tar.bz2
* 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/cygwin/fhandler_tape.cc')
-rw-r--r--winsup/cygwin/fhandler_tape.cc7
1 files changed, 2 insertions, 5 deletions
diff --git a/winsup/cygwin/fhandler_tape.cc b/winsup/cygwin/fhandler_tape.cc
index 1e31ee1..c86b0f4 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