From c127c29235d707021a6ae79c11b4da0643484f54 Mon Sep 17 00:00:00 2001 From: Tomohiro Kusumi Date: Tue, 20 Aug 2019 03:12:20 +0900 Subject: [PATCH] sbin/hammer2: Fix remaining type warnings on Linux distros Bring in local changes existed in https://github.com/kusumi/lh1. These ondisk fields are not of char*. --- sbin/hammer2/cmd_info.c | 2 +- sbin/hammer2/cmd_remote.c | 6 ++++-- sbin/hammer2/cmd_service.c | 6 +++--- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/sbin/hammer2/cmd_info.c b/sbin/hammer2/cmd_info.c index 8108e8df1a..30a653afdb 100644 --- a/sbin/hammer2/cmd_info.c +++ b/sbin/hammer2/cmd_info.c @@ -363,7 +363,7 @@ h2pfs_check(int fd, hammer2_blockref_t *bref, } } else if (media.ipdata.meta.op_flags & HAMMER2_OPFLAG_PFSROOT) { - callback2(media.ipdata.filename, bref, fd); + callback2((char*)media.ipdata.filename, bref, fd); bscan = NULL; bcount = 0; } else { diff --git a/sbin/hammer2/cmd_remote.c b/sbin/hammer2/cmd_remote.c index e6417984f0..7e55ea33a9 100644 --- a/sbin/hammer2/cmd_remote.c +++ b/sbin/hammer2/cmd_remote.c @@ -52,7 +52,8 @@ cmd_remote_connect(const char *sel_path, const char *url) close(fd); return(1); } - snprintf(remote.copy1.path, sizeof(remote.copy1.path), "%s", url); + snprintf((char*)remote.copy1.path, sizeof(remote.copy1.path), "%s", + url); if (ioctl(fd, HAMMER2IOC_REMOTE_ADD, &remote) < 0) { perror("ioctl"); ecode = 1; @@ -78,7 +79,8 @@ cmd_remote_disconnect(const char *sel_path, const char *url) close(fd); return(1); } - snprintf(remote.copy1.path, sizeof(remote.copy1.path), "%s", url); + snprintf((char*)remote.copy1.path, sizeof(remote.copy1.path), "%s", + url); if (ioctl(fd, HAMMER2IOC_REMOTE_DEL, &remote) < 0) { perror("ioctl"); ecode = 1; diff --git a/sbin/hammer2/cmd_service.c b/sbin/hammer2/cmd_service.c index dbb613a3fb..f05869c688 100644 --- a/sbin/hammer2/cmd_service.c +++ b/sbin/hammer2/cmd_service.c @@ -407,15 +407,15 @@ hammer2_volconf_thread(void *info) hammer2_volconf_stop(conf); conf->copy_run = conf->copy_pend; if (conf->copy_run.copyid != 0 && - strncmp(conf->copy_run.path, "span:", 5) == 0) { + strncmp((char*)conf->copy_run.path, "span:", 5) == 0) { hammer2_volconf_start(conf, - conf->copy_run.path + 5); + (char*)conf->copy_run.path + 5); } pthread_mutex_lock(&confmtx); fprintf(stderr, "VOLCONF UPDATE DONE state %d\n", conf->state); } if (conf->state == H2MC_CONNECT) { - hammer2_volconf_start(conf, conf->copy_run.path + 5); + hammer2_volconf_start(conf, (char*)conf->copy_run.path + 5); pthread_mutex_unlock(&confmtx); sleep(5); pthread_mutex_lock(&confmtx); -- 2.41.0