From 48b60cffda5196f0b84bb2279fe03d26b67a736f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=BD=D0=B0=D0=B1?= Date: Fri, 2 Apr 2021 17:32:51 +0200 Subject: [PATCH] zed: remove unused zed_file_read_n() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Same deal as zed_file_close_on_exec() Reviewed-by: Brian Behlendorf Signed-off-by: Ahelenia ZiemiaƄska Closes #11834 --- cmd/zed/zed_file.c | 29 ----------------------------- cmd/zed/zed_file.h | 2 -- 2 files changed, 31 deletions(-) diff --git a/cmd/zed/zed_file.c b/cmd/zed/zed_file.c index c7b0d00b6b..aeaa7a014c 100644 --- a/cmd/zed/zed_file.c +++ b/cmd/zed/zed_file.c @@ -24,35 +24,6 @@ #include "zed_file.h" #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 28a5dd0cca..28473a545b 100644 --- a/cmd/zed/zed_file.h +++ b/cmd/zed/zed_file.h @@ -18,8 +18,6 @@ #include #include -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);