From 8eb3e364e3e93d666cb07e3255f53a91ddf15b18 Mon Sep 17 00:00:00 2001 From: pooka Date: Tue, 20 Oct 2009 02:05:45 +0000 Subject: [PATCH] fix warnings, update interface to use rump_pub --- share/examples/rump/img2cgd/img2cgd.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/share/examples/rump/img2cgd/img2cgd.c b/share/examples/rump/img2cgd/img2cgd.c index d3e676081684..1248801f442b 100644 --- a/share/examples/rump/img2cgd/img2cgd.c +++ b/share/examples/rump/img2cgd/img2cgd.c @@ -1,4 +1,4 @@ -/* $NetBSD: img2cgd.c,v 1.2 2009/09/08 21:51:33 pooka Exp $ */ +/* $NetBSD: img2cgd.c,v 1.3 2009/10/20 02:05:45 pooka Exp $ */ /* * Copyright (c) 2009 Antti Kantee. All Rights Reserved. @@ -29,6 +29,7 @@ #include #include +#include #include #include #include @@ -38,6 +39,8 @@ #include #include +#include "cgdconfig.h" + /* * We really should use disklabel. However, for the time being, * use a endian independent magic number at offset == 0 and a @@ -96,7 +99,7 @@ doxfer(int fd_from, int fd_to, off_t nbytes, readfn rfn, writefn wfn, int main(int argc, char *argv[]) { - const char *the_argv[10]; + char *the_argv[10]; const char *cgd_file, *img_file; struct stat sb_cgd, sb_file; off_t nbytes; @@ -179,16 +182,16 @@ main(int argc, char *argv[]) } rump_init(); - if ((error = rump_etfs_register("/cryptfile", cgd_file, + if ((error = rump_pub_etfs_register("/cryptfile", cgd_file, RUMP_ETFS_BLK)) != 0) { printf("etfs: %d\n", error); exit(1); } - the_argv[0] = "cgdconfig"; - the_argv[1] = "cgd0"; - the_argv[2] = "/cryptfile"; - the_argv[3] = "./cgd.conf"; + the_argv[0] = strdup("cgdconfig"); + the_argv[1] = strdup("cgd0"); + the_argv[2] = strdup("/cryptfile"); + the_argv[3] = strdup("./cgd.conf"); the_argv[4] = NULL; error = cgdconfig(4, the_argv); if (error) {