From c11a57b8cb8204b966abf45fdf4e7d1e25676012 Mon Sep 17 00:00:00 2001 From: Richard Nyberg Date: Sat, 30 Jul 2005 18:42:59 +0000 Subject: [PATCH] Fix style. Remove unnecessary check for EINTR. --- misc/stream.c | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/misc/stream.c b/misc/stream.c index ee98374..4d94342 100644 --- a/misc/stream.c +++ b/misc/stream.c @@ -1,7 +1,7 @@ #include #include -#include #include +#include #include #include @@ -73,14 +73,9 @@ bts_read_ro(struct bt_stream_ro *bts, char *buf, size_t len) } wantread = min(len - boff, files[bts->index].length - bts->f_off); - again: didread = read(bts->fd, buf + boff, wantread); - if (didread == -1) { - if (errno == EINTR) - goto again; - else - return errno; - } + if (didread == -1) + return errno; boff += didread; bts->f_off += didread; @@ -129,9 +124,9 @@ bts_sha(struct bt_stream_ro *bts, off_t length, uint8_t *hash) int bts_hashes(struct metainfo *meta, - F_fdcb fd_cb, - void (*cb)(uint32_t, uint8_t *, void *), - void *arg) + F_fdcb fd_cb, + void (*cb)(uint32_t, uint8_t *, void *), + void *arg) { int err = 0; uint8_t hash[SHA_DIGEST_LENGTH]; @@ -204,7 +199,7 @@ bts_write_wo(struct bt_stream_wo *bts, const char *buf, size_t len) wantwrite = min(len - boff, files[bts->index].length - bts->f_off); didwrite = write(bts->fd, buf + boff, wantwrite); if (didwrite == -1) - return errno; + return errno; boff += didwrite; bts->f_off += didwrite;