Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/share/examples/rump/img2cgd fix warnings, update interface t...



details:   https://anonhg.NetBSD.org/src/rev/5d1605e0b2e9
branches:  trunk
changeset: 748311:5d1605e0b2e9
user:      pooka <pooka%NetBSD.org@localhost>
date:      Tue Oct 20 02:05:45 2009 +0000

description:
fix warnings, update interface to use rump_pub

diffstat:

 share/examples/rump/img2cgd/img2cgd.c |  17 ++++++++++-------
 1 files changed, 10 insertions(+), 7 deletions(-)

diffs (57 lines):

diff -r aedb5d3c3dd4 -r 5d1605e0b2e9 share/examples/rump/img2cgd/img2cgd.c
--- a/share/examples/rump/img2cgd/img2cgd.c     Tue Oct 20 01:41:44 2009 +0000
+++ b/share/examples/rump/img2cgd/img2cgd.c     Tue Oct 20 02:05:45 2009 +0000
@@ -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) {



Home | Main Index | Thread Index | Old Index