From: Pavel Charvat Date: Tue, 3 Jun 2014 12:13:51 +0000 (+0200) Subject: Careful I/O: Converted to size_t. X-Git-Tag: v6.0~17 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=aad7bdf851e8c7aea4e4ba00e831837e5137f331;p=libucw.git Careful I/O: Converted to size_t. --- diff --git a/ucw/io-careful.c b/ucw/io-careful.c index b12b7114..a3a8a806 100644 --- a/ucw/io-careful.c +++ b/ucw/io-careful.c @@ -18,12 +18,12 @@ */ int -careful_read(int fd, void *buf, int len) +careful_read(int fd, void *buf, size_t len) { byte *pos = buf; while (len) { - int l = read(fd, pos, len); + ssize_t l = read(fd, pos, len); if (l < 0) return -1; if (!l) @@ -35,12 +35,12 @@ careful_read(int fd, void *buf, int len) } int -careful_write(int fd, const void *buf, int len) +careful_write(int fd, const void *buf, size_t len) { const byte *pos = buf; while (len) { - int l = write(fd, pos, len); + ssize_t l = write(fd, pos, len); if (l < 0) return -1; if (!l) diff --git a/ucw/io.h b/ucw/io.h index 73992135..36b35243 100644 --- a/ucw/io.h +++ b/ucw/io.h @@ -70,8 +70,8 @@ void munmap_file(void *start, unsigned len); /* io-careful.c */ -int careful_read(int fd, void *buf, int len); -int careful_write(int fd, const void *buf, int len); +int careful_read(int fd, void *buf, size_t len); +int careful_write(int fd, const void *buf, size_t len); /* io-sync.c */