summaryrefslogtreecommitdiffstats
path: root/utils/mirror_vfd
diff options
context:
space:
mode:
authorDana Robinson <43805+derobins@users.noreply.github.com>2023-06-28 15:31:32 (GMT)
committerGitHub <noreply@github.com>2023-06-28 15:31:32 (GMT)
commit187ea8a9ae1405b5b46ca47a32fb1fb9e2686c98 (patch)
treebaffa167d0796786241aef6b0ce76d4adec3b66e /utils/mirror_vfd
parent7a44581a84778a1346a2fd5b6cca7d9db905a321 (diff)
downloadhdf5-187ea8a9ae1405b5b46ca47a32fb1fb9e2686c98.zip
hdf5-187ea8a9ae1405b5b46ca47a32fb1fb9e2686c98.tar.gz
hdf5-187ea8a9ae1405b5b46ca47a32fb1fb9e2686c98.tar.bz2
Rename HD(f)printf() to (f)printf() (#3194)
Diffstat (limited to 'utils/mirror_vfd')
-rw-r--r--utils/mirror_vfd/mirror_remote.c40
-rw-r--r--utils/mirror_vfd/mirror_server.c38
-rw-r--r--utils/mirror_vfd/mirror_server_stop.c40
3 files changed, 59 insertions, 59 deletions
diff --git a/utils/mirror_vfd/mirror_remote.c b/utils/mirror_vfd/mirror_remote.c
index a2cf95c..065f2c8 100644
--- a/utils/mirror_vfd/mirror_remote.c
+++ b/utils/mirror_vfd/mirror_remote.c
@@ -43,15 +43,15 @@ mirror_log(struct mirror_log_info *info, unsigned int level, const char *format,
}
else if (level <= verbosity) {
if (custom == true && info->prefix[0] != '\0') {
- HDfprintf(stream, "%s", info->prefix);
+ fprintf(stream, "%s", info->prefix);
}
switch (level) {
case (V_ERR):
- HDfprintf(stream, "ERROR ");
+ fprintf(stream, "ERROR ");
break;
case (V_WARN):
- HDfprintf(stream, "WARNING ");
+ fprintf(stream, "WARNING ");
break;
default:
break;
@@ -64,7 +64,7 @@ mirror_log(struct mirror_log_info *info, unsigned int level, const char *format,
va_end(args);
}
- HDfprintf(stream, "\n");
+ fprintf(stream, "\n");
HDfflush(stream);
} /* end if sufficiently verbose to print */
} /* end mirror_log() */
@@ -98,41 +98,41 @@ mirror_log_bytes(struct mirror_log_info *info, unsigned int level, size_t n_byte
/* print whole lines */
while ((n_bytes - bytes_written) >= 32) {
b = buf + bytes_written; /* point to region in buffer */
- HDfprintf(stream,
- "%04zX %02X%02X%02X%02X %02X%02X%02X%02X"
- " %02X%02X%02X%02X %02X%02X%02X%02X"
- " %02X%02X%02X%02X %02X%02X%02X%02X"
- " %02X%02X%02X%02X %02X%02X%02X%02X\n",
- bytes_written, b[0], b[1], b[2], b[3], b[4], b[5], b[6], b[7], b[8], b[9], b[10], b[11],
- b[12], b[13], b[14], b[15], b[16], b[17], b[18], b[19], b[20], b[21], b[22], b[23],
- b[24], b[25], b[26], b[27], b[28], b[29], b[30], b[31]);
+ fprintf(stream,
+ "%04zX %02X%02X%02X%02X %02X%02X%02X%02X"
+ " %02X%02X%02X%02X %02X%02X%02X%02X"
+ " %02X%02X%02X%02X %02X%02X%02X%02X"
+ " %02X%02X%02X%02X %02X%02X%02X%02X\n",
+ bytes_written, b[0], b[1], b[2], b[3], b[4], b[5], b[6], b[7], b[8], b[9], b[10], b[11],
+ b[12], b[13], b[14], b[15], b[16], b[17], b[18], b[19], b[20], b[21], b[22], b[23], b[24],
+ b[25], b[26], b[27], b[28], b[29], b[30], b[31]);
bytes_written += 32;
}
/* start partial line */
if (n_bytes > bytes_written) {
- HDfprintf(stream, "%04zX ", bytes_written);
+ fprintf(stream, "%04zX ", bytes_written);
}
/* partial line blocks */
while ((n_bytes - bytes_written) >= 4) {
- HDfprintf(stream, " %02X%02X%02X%02X", buf[bytes_written], buf[bytes_written + 1],
- buf[bytes_written + 2], buf[bytes_written + 3]);
+ fprintf(stream, " %02X%02X%02X%02X", buf[bytes_written], buf[bytes_written + 1],
+ buf[bytes_written + 2], buf[bytes_written + 3]);
bytes_written += 4;
}
/* block separator before partial block */
if (n_bytes > bytes_written) {
- HDfprintf(stream, " ");
+ fprintf(stream, " ");
}
/* partial block individual bytes */
while (n_bytes > bytes_written) {
- HDfprintf(stream, "%02X", buf[bytes_written++]);
+ fprintf(stream, "%02X", buf[bytes_written++]);
}
/* end partial line */
- HDfprintf(stream, "\n");
+ fprintf(stream, "\n");
} /* end if suitably verbose to log */
} /* end mirror_log_bytes() */
@@ -165,8 +165,8 @@ mirror_log_init(char *path, const char *prefix, unsigned int verbosity)
FILE *f = NULL;
f = HDfopen(path, "w");
if (NULL == f) {
- HDfprintf(MIRROR_LOG_DEFAULT_STREAM, "WARN custom logging path could not be opened: %s\n",
- path);
+ fprintf(MIRROR_LOG_DEFAULT_STREAM, "WARN custom logging path could not be opened: %s\n",
+ path);
info->magic += 1;
HDfree(info);
}
diff --git a/utils/mirror_vfd/mirror_server.c b/utils/mirror_vfd/mirror_server.c
index 03c72a4..83d6f20 100644
--- a/utils/mirror_vfd/mirror_server.c
+++ b/utils/mirror_vfd/mirror_server.c
@@ -139,22 +139,22 @@ struct server_run {
static void
usage(void)
{
- HDfprintf(stdout,
- "mirror_server [options]\n"
- "\n"
- "Application for providing Mirror Writer process to "
- " Mirror VFD on file-open.\n"
- "Listens on a dedicated socket; forks as a Writer upon receipt"
- " of a valid OPEN xmit.\n"
- "\n"
- "Options:\n"
- "--help [-h] : Print this help message and quit.\n"
- "--logpath=PATH : File path for logging output "
- "(default none, to stdout).\n"
- "--port=PORT : Primary port (default %d).\n"
- "--verbosity=NUM : Debug printing level "
- "0..4, (default %d).\n",
- DEFAULT_PORT, MIRROR_LOG_DEFAULT_VERBOSITY);
+ fprintf(stdout,
+ "mirror_server [options]\n"
+ "\n"
+ "Application for providing Mirror Writer process to "
+ " Mirror VFD on file-open.\n"
+ "Listens on a dedicated socket; forks as a Writer upon receipt"
+ " of a valid OPEN xmit.\n"
+ "\n"
+ "Options:\n"
+ "--help [-h] : Print this help message and quit.\n"
+ "--logpath=PATH : File path for logging output "
+ "(default none, to stdout).\n"
+ "--port=PORT : Primary port (default %d).\n"
+ "--verbosity=NUM : Debug printing level "
+ "0..4, (default %d).\n",
+ DEFAULT_PORT, MIRROR_LOG_DEFAULT_VERBOSITY);
} /* end usage() */
/* ---------------------------------------------------------------------------
@@ -562,10 +562,10 @@ handle_requests(struct server_run *run)
else if (pid == 0) { /* child process (writer side of fork) */
mirror_log(run->loginfo, V_INFO, "executing writer");
if (run_writer(connfd, xopen) < 0) {
- HDprintf("can't run writer\n");
+ printf("can't run writer\n");
}
else {
- HDprintf("writer OK\n");
+ printf("writer OK\n");
}
HDclose(connfd);
@@ -634,7 +634,7 @@ main(int argc, char **argv)
int
main(void)
{
- HDprintf("Mirror VFD was not built -- cannot launch server.\n");
+ printf("Mirror VFD was not built -- cannot launch server.\n");
HDexit(EXIT_FAILURE);
}
diff --git a/utils/mirror_vfd/mirror_server_stop.c b/utils/mirror_vfd/mirror_server_stop.c
index f54b210..1546d70 100644
--- a/utils/mirror_vfd/mirror_server_stop.c
+++ b/utils/mirror_vfd/mirror_server_stop.c
@@ -60,15 +60,15 @@ struct mshs_opts {
static void
usage(void)
{
- 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"
- "Options:\n"
- " -h | --help Print this usage message and exit.\n"
- " --ip=ADDR IP Address of remote server (default %s)\n"
- " --port=PORT Handshake port of remote server (default %d)\n",
- MSHS_DEFAULT_IP, MSHS_DEFAULT_PORTNO);
+ printf("mirror_server_stop [options]\n"
+ "System-independent Mirror Server shutdown program.\n"
+ "Sends shutdown message to Mirror Server at given IP:port\n"
+ "\n"
+ "Options:\n"
+ " -h | --help Print this usage message and exit.\n"
+ " --ip=ADDR IP Address of remote server (default %s)\n"
+ " --port=PORT Handshake port of remote server (default %d)\n",
+ MSHS_DEFAULT_IP, MSHS_DEFAULT_PORTNO);
} /* end usage() */
/* ----------------------------------------------------------------------------
@@ -102,7 +102,7 @@ parse_args(int argc, char **argv, struct mshs_opts *opts)
opts->portno = HDatoi(argv[i] + 7);
}
else {
- HDprintf("Unrecognized option: '%s'\n", argv[i]);
+ printf("Unrecognized option: '%s'\n", argv[i]);
usage();
opts->magic++; /* invalidate for sanity */
return -1;
@@ -133,13 +133,13 @@ send_shutdown(struct mshs_opts *opts)
struct sockaddr_in target_addr;
if (opts->magic != MSHS_OPTS_MAGIC) {
- HDprintf("invalid options structure\n");
+ printf("invalid options structure\n");
return -1;
}
live_socket = socket(AF_INET, SOCK_STREAM, 0);
if (live_socket < 0) {
- HDprintf("ERROR socket()\n");
+ printf("ERROR socket()\n");
return -1;
}
@@ -149,27 +149,27 @@ send_shutdown(struct mshs_opts *opts)
HDmemset(target_addr.sin_zero, 0, sizeof(target_addr.sin_zero));
if (connect(live_socket, (struct sockaddr *)&target_addr, (socklen_t)sizeof(target_addr)) < 0) {
- HDprintf("ERROR connect() (%d)\n%s\n", errno, HDstrerror(errno));
+ printf("ERROR connect() (%d)\n%s\n", errno, HDstrerror(errno));
return -1;
}
if (HDwrite(live_socket, "SHUTDOWN", 9) == -1) {
- HDprintf("ERROR write() (%d)\n%s\n", errno, HDstrerror(errno));
+ printf("ERROR write() (%d)\n%s\n", errno, HDstrerror(errno));
return -1;
}
/* Read & verify response from port connection. */
if (HDread(live_socket, &mybuf, sizeof(mybuf)) == -1) {
- HDprintf("ERROR read() can't receive data\n");
+ printf("ERROR read() can't receive data\n");
return -1;
}
if (HDstrncmp("CLOSING", mybuf, 8)) {
- HDprintf("ERROR read() didn't receive data from server\n");
+ printf("ERROR read() didn't receive data from server\n");
return -1;
}
if (HDclose(live_socket) < 0) {
- HDprintf("ERROR close() can't close socket\n");
+ printf("ERROR close() can't close socket\n");
return -1;
}
@@ -183,7 +183,7 @@ main(int argc, char **argv)
struct mshs_opts opts;
if (parse_args(argc, argv, &opts) < 0) {
- HDprintf("Unable to parse arguments\n");
+ printf("Unable to parse arguments\n");
HDexit(EXIT_FAILURE);
}
@@ -193,7 +193,7 @@ main(int argc, char **argv)
}
if (send_shutdown(&opts) < 0) {
- HDprintf("Unable to send shutdown command\n");
+ printf("Unable to send shutdown command\n");
HDexit(EXIT_FAILURE);
}
@@ -206,7 +206,7 @@ main(int argc, char **argv)
int
main(void)
{
- HDprintf("Mirror VFD not built -- unable to perform shutdown.\n");
+ printf("Mirror VFD not built -- unable to perform shutdown.\n");
HDexit(EXIT_FAILURE);
}