sbin/hammer2: Fix remaining type warnings on Linux distros
authorTomohiro Kusumi <kusumi.tomohiro@gmail.com>
Mon, 19 Aug 2019 18:12:20 +0000 (03:12 +0900)
committerTomohiro Kusumi <kusumi.tomohiro@gmail.com>
Mon, 19 Aug 2019 18:32:36 +0000 (03:32 +0900)
Bring in local changes existed in https://github.com/kusumi/lh1.
These ondisk fields are not of char*.

sbin/hammer2/cmd_info.c
sbin/hammer2/cmd_remote.c
sbin/hammer2/cmd_service.c

index 8108e8d..30a653a 100644 (file)
@@ -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 {
index e641798..7e55ea3 100644 (file)
@@ -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;
index dbb613a..f05869c 100644 (file)
@@ -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);