summaryrefslogtreecommitdiffstats
path: root/utils/mirror_vfd/mirror_server_stop.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@lbl.gov>2022-04-26 16:07:15 (GMT)
committerGitHub <noreply@github.com>2022-04-26 16:07:15 (GMT)
commit417ee1393b425d5c7c998562e7fb492e28928643 (patch)
treed48c7a30907029af36b5b82c81bc0eb7f835082c /utils/mirror_vfd/mirror_server_stop.c
parent0fffb26c013146cc817ab1c9f2956ad84919a63e (diff)
downloadhdf5-417ee1393b425d5c7c998562e7fb492e28928643.zip
hdf5-417ee1393b425d5c7c998562e7fb492e28928643.tar.gz
hdf5-417ee1393b425d5c7c998562e7fb492e28928643.tar.bz2
Correct concurrency bugs when running tests, along with a bugfix & small warning cleanup (#1683)
* Correct concurrency bugs when running tests, along with a bugfix & small warning cleanup. * Committing clang-format changes Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Diffstat (limited to 'utils/mirror_vfd/mirror_server_stop.c')
-rw-r--r--utils/mirror_vfd/mirror_server_stop.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/utils/mirror_vfd/mirror_server_stop.c b/utils/mirror_vfd/mirror_server_stop.c
index 024b33a..44386bf 100644
--- a/utils/mirror_vfd/mirror_server_stop.c
+++ b/utils/mirror_vfd/mirror_server_stop.c
@@ -60,7 +60,7 @@ struct mshs_opts {
static void
usage(void)
{
- HDprintf("mirror_server_halten_sie [options]\n"
+ HDprintf("mirror_server_stop [options]\n"
"System-independent Mirror Server shutdown program.\n"
"Sends shutdown message to Mirror Server at given IP:port\n"
"\n"
@@ -128,6 +128,7 @@ parse_args(int argc, char **argv, struct mshs_opts *opts)
static int
send_shutdown(struct mshs_opts *opts)
{
+ char mybuf[16];
int live_socket;
struct sockaddr_in target_addr;
@@ -157,6 +158,16 @@ send_shutdown(struct mshs_opts *opts)
return -1;
}
+ /* Read & verify response from port connection. */
+ if (HDread(live_socket, &mybuf, sizeof(mybuf)) == -1) {
+ HDprintf("ERROR read() can't receive data\n");
+ return -1;
+ }
+ if (HDstrncmp("CLOSING", mybuf, 8)) {
+ HDprintf("ERROR read() didn't receive data from server\n");
+ return -1;
+ }
+
if (HDclose(live_socket) < 0) {
HDprintf("ERROR close() can't close socket\n");
return -1;