Module Name: src
Committed By: pooka
Date: Tue Oct 20 02:05:45 UTC 2009
Modified Files:
src/share/examples/rump/img2cgd: img2cgd.c
Log Message:
fix warnings, update interface to use rump_pub
To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/share/examples/rump/img2cgd/img2cgd.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/share/examples/rump/img2cgd/img2cgd.c
diff -u src/share/examples/rump/img2cgd/img2cgd.c:1.2 src/share/examples/rump/img2cgd/img2cgd.c:1.3
--- src/share/examples/rump/img2cgd/img2cgd.c:1.2 Tue Sep 8 21:51:33 2009
+++ src/share/examples/rump/img2cgd/img2cgd.c Tue Oct 20 02:05:45 2009
@@ -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 <sys/param.h>
#include <assert.h>
+#include <err.h>
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
@@ -38,6 +39,8 @@
#include <rump/rump.h>
#include <rump/rump_syscalls.h>
+#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 @@
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 @@
}
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) {