Source-Changes-HG archive

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

[src/trunk]: src/share/examples/rump/sdread Try ffs is msdosfs mount fails --...



details:   https://anonhg.NetBSD.org/src/rev/2ad51d372f97
branches:  trunk
changeset: 748099:2ad51d372f97
user:      pooka <pooka%NetBSD.org@localhost>
date:      Tue Oct 13 18:41:06 2009 +0000

description:
Try ffs is msdosfs mount fails -- I happened to have one USB stick
where the file system is ffs.

diffstat:

 share/examples/rump/sdread/Makefile |   4 ++--
 share/examples/rump/sdread/sdread.c |  15 ++++++++++++---
 2 files changed, 14 insertions(+), 5 deletions(-)

diffs (63 lines):

diff -r 8d3e6f84e9ce -r 2ad51d372f97 share/examples/rump/sdread/Makefile
--- a/share/examples/rump/sdread/Makefile       Tue Oct 13 18:36:48 2009 +0000
+++ b/share/examples/rump/sdread/Makefile       Tue Oct 13 18:41:06 2009 +0000
@@ -1,9 +1,9 @@
-#      $NetBSD: Makefile,v 1.1 2009/10/05 13:05:31 pooka Exp $
+#      $NetBSD: Makefile,v 1.2 2009/10/13 18:41:06 pooka Exp $
 #
 
 PROG=  sdread
 
-LDADD+=        -lrumpfs_msdos -lrumpvfs
+LDADD+=        -lrumpfs_ffs -lrumpfs_msdos -lrumpvfs
 LDADD+=        -lrumpdev_disk -lrumpdev_usb -lrumpdev_usbhc -lrumpdev_umass -lrumpdev
 LDADD+=        -lrump
 LDADD+=        -lrumpuser -lpthread
diff -r 8d3e6f84e9ce -r 2ad51d372f97 share/examples/rump/sdread/sdread.c
--- a/share/examples/rump/sdread/sdread.c       Tue Oct 13 18:36:48 2009 +0000
+++ b/share/examples/rump/sdread/sdread.c       Tue Oct 13 18:41:06 2009 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sdread.c,v 1.1 2009/10/05 13:05:31 pooka Exp $ */
+/*     $NetBSD: sdread.c,v 1.2 2009/10/13 18:41:06 pooka Exp $ */
 
 /*
  * Copyright (c) 2009 Antti Kantee.  All Rights Reserved.
@@ -29,6 +29,7 @@
 #include <sys/dirent.h>
 #include <sys/mount.h>
 
+#include <ufs/ufs/ufsmount.h>
 #include <msdosfs/msdosfsmount.h>
 
 #include <rump/rump.h>
@@ -54,6 +55,7 @@
 {
        char buf[2048];
        struct msdosfs_args args;
+       struct ufs_args uargs;
        struct dirent *dp;
        const char *msg = NULL;
        int fd, n, fd_h, sverrno;
@@ -67,13 +69,20 @@
        args.fspec = strdup("/dev/sd0e");
        args.version = MSDOSFSMNT_VERSION;
 
+       memset(&uargs, 0, sizeof(uargs));
+       uargs.fspec = strdup("/dev/sd0e");
+
        rump_init();
 
        if (rump_sys_mkdir("/mp", 0777) == -1)
                err(1, "mkdir");
        if (rump_sys_mount(MOUNT_MSDOS, "/mp", MNT_RDONLY,
-           &args, sizeof(args)) == -1)
-               err(1, "mount");
+           &args, sizeof(args)) == -1) {
+               if (rump_sys_mount(MOUNT_FFS, "/mp", MNT_RDONLY,
+                   &uargs, sizeof(uargs)) == -1) {
+                       err(1, "mount");
+               }
+       }
 
        fd = rump_sys_open("/mp", O_RDONLY, 0);
        if (fd == -1) {



Home | Main Index | Thread Index | Old Index