diff options
author | наб <[email protected]> | 2021-04-02 17:32:51 +0200 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2021-04-07 14:51:24 -0700 |
commit | 0d0720eb52c1e69d455d4b24381e328c65138380 (patch) | |
tree | 2a0cec10582be913d86c66c0c2df453172779295 /cmd/zed | |
parent | 1a05182ba0dd26204757cef1f22f4c229c3ee112 (diff) |
zed: remove unused zed_file_read_n()
Same deal as zed_file_close_on_exec()
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Ahelenia Ziemiańska <[email protected]>
Closes #11834
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); |