diff options
Diffstat (limited to 'cmd/zed')
-rw-r--r-- | cmd/zed/zed_file.c | 29 | ||||
-rw-r--r-- | cmd/zed/zed_file.h | 2 |
2 files changed, 0 insertions, 31 deletions
diff --git a/cmd/zed/zed_file.c b/cmd/zed/zed_file.c index c7b0d00b6..aeaa7a014 100644 --- a/cmd/zed/zed_file.c +++ b/cmd/zed/zed_file.c @@ -25,35 +25,6 @@ #include "zed_log.h" /* - * Read up to [n] bytes from [fd] into [buf]. - * Return the number of bytes read, 0 on EOF, or -1 on error. - */ -ssize_t -zed_file_read_n(int fd, void *buf, size_t n) -{ - unsigned char *p; - size_t n_left; - ssize_t n_read; - - p = buf; - n_left = n; - while (n_left > 0) { - if ((n_read = read(fd, p, n_left)) < 0) { - if (errno == EINTR) - continue; - else - return (-1); - - } else if (n_read == 0) { - break; - } - n_left -= n_read; - p += n_read; - } - return (n - n_left); -} - -/* * Write [n] bytes from [buf] out to [fd]. * Return the number of bytes written, or -1 on error. */ diff --git a/cmd/zed/zed_file.h b/cmd/zed/zed_file.h index 28a5dd0cc..28473a545 100644 --- a/cmd/zed/zed_file.h +++ b/cmd/zed/zed_file.h @@ -18,8 +18,6 @@ #include <sys/types.h> #include <unistd.h> -ssize_t zed_file_read_n(int fd, void *buf, size_t n); - ssize_t zed_file_write_n(int fd, void *buf, size_t n); int zed_file_lock(int fd); |