diff options
author | Larry Knox <lrknox@hdfgroup.org> | 2022-02-21 21:32:29 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-21 21:32:29 (GMT) |
commit | 3107fafa2ce858b598617463334d3d6d01dc1e4c (patch) | |
tree | 68e4cafcbbd96fa35dfd4a66a55078509e928c7b /utils/mirror_vfd/mirror_writer.c | |
parent | c302773438a4db0b56d32eaf9cf8a92b56848c0a (diff) | |
download | hdf5-3107fafa2ce858b598617463334d3d6d01dc1e4c.zip hdf5-3107fafa2ce858b598617463334d3d6d01dc1e4c.tar.gz hdf5-3107fafa2ce858b598617463334d3d6d01dc1e4c.tar.bz2 |
Oess 168 utils mirror vfd (#1444)
* Committing clang-format changes
* Spelling of preceed was corrected to proceed, but should have been
corrected to precede.
* Correct spelling correction of 'preceed' incorrectly to 'proceed'. It should be 'precede'.
* OESS-168: Remove clang warnings.
* OESS-168: Address @lrknox and @gnuoyd reviews.
* Eliminate clang warnings listed in PR #1310 without adding new ssize_t
variables.
* Committing clang-format changes
* Add H5_ATTR_UNUSED to wait_for_child call.
Remove unneeded casts in mirror_log calls.
* Keep ssize_t in mirror_server.c line 479.
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Hyo-Kyung Lee <hyoklee@hdfgroup.org>
Diffstat (limited to 'utils/mirror_vfd/mirror_writer.c')
-rw-r--r-- | utils/mirror_vfd/mirror_writer.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/utils/mirror_vfd/mirror_writer.c b/utils/mirror_vfd/mirror_writer.c index d3f12de..5726db5 100644 --- a/utils/mirror_vfd/mirror_writer.c +++ b/utils/mirror_vfd/mirror_writer.c @@ -788,8 +788,7 @@ do_write(struct mirror_session *session, const unsigned char *xmit_buf) */ sum_bytes_written = 0; do { - nbytes_in_packet = HDread(session->sockfd, buf, H5FD_MIRROR_DATA_BUFFER_MAX); - if (-1 == nbytes_in_packet) { + if ((nbytes_in_packet = HDread(session->sockfd, buf, H5FD_MIRROR_DATA_BUFFER_MAX)) < 0) { mirror_log(session->loginfo, V_ERR, "can't read into databuffer"); reply_error(session, "can't read data buffer"); return -1; @@ -798,7 +797,7 @@ do_write(struct mirror_session *session, const unsigned char *xmit_buf) mirror_log(session->loginfo, V_INFO, "received %zd bytes", nbytes_in_packet); if (HEXDUMP_WRITEDATA) { mirror_log(session->loginfo, V_ALL, "DATA:\n```"); - mirror_log_bytes(session->loginfo, V_ALL, nbytes_in_packet, (const unsigned char *)buf); + mirror_log_bytes(session->loginfo, V_ALL, (size_t)nbytes_in_packet, (const unsigned char *)buf); mirror_log(session->loginfo, V_ALL, "```"); } @@ -859,8 +858,7 @@ receive_communique(struct mirror_session *session, struct sock_comm *comm) mirror_log(session->loginfo, V_INFO, "ready to receive"); /* TODO */ - read_ret = HDread(session->sockfd, comm->raw, H5FD_MIRROR_XMIT_BUFFER_MAX); - if (-1 == read_ret) { + if ((read_ret = HDread(session->sockfd, comm->raw, H5FD_MIRROR_XMIT_BUFFER_MAX)) < 0) { mirror_log(session->loginfo, V_ERR, "read:%zd", read_ret); goto error; } |