Module Name:    othersrc
Committed By:   pooka
Date:           Sun Dec 13 20:53:33 UTC 2009

Modified Files:
        othersrc/lib/libfsu_mount: fsu_mount.c

Log Message:
Support ukfs magic paths.  For example, this works now:
golem> fsu_ls wd0.img%DISKLABEL:a% -l


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 othersrc/lib/libfsu_mount/fsu_mount.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: othersrc/lib/libfsu_mount/fsu_mount.c
diff -u othersrc/lib/libfsu_mount/fsu_mount.c:1.16 othersrc/lib/libfsu_mount/fsu_mount.c:1.17
--- othersrc/lib/libfsu_mount/fsu_mount.c:1.16	Sun Dec 13 20:35:14 2009
+++ othersrc/lib/libfsu_mount/fsu_mount.c	Sun Dec 13 20:53:33 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: fsu_mount.c,v 1.16 2009/12/13 20:35:14 pooka Exp $ */
+/* $NetBSD: fsu_mount.c,v 1.17 2009/12/13 20:53:33 pooka Exp $ */
 
 /*
  * Copyright (c) 2008,2009 Arnaud Ysmal.  All Rights Reserved.
@@ -85,6 +85,7 @@
 	char **mntd_argv;
 	int mntd_argv_size;
 	char *mntd_cwd;
+	struct ukfs_part *mntd_part;
 };
 
 static struct ukfs *mount_alias(struct fsu_fsalias_s *, char *, char *,
@@ -106,10 +107,10 @@
 	fsu_fs_t *fst;
 	struct fsu_fsalias_s *alias;
 	struct mount_data_s mntd;
-	int idx;
+	int idx, fflag;
 	char ch, *mntopts, afsdev[MAXPATHLEN], *path, *puffsexec, *specopts;
 	char *tmp;
-	const char *fsdevice, *fstype;
+	char *fsdevice, *fstype;
 	struct stat sb;
 #ifdef WITH_SYSPUFFS
 	const char options[] = "f:o:p:s:t:";
@@ -122,6 +123,7 @@
 	fst = NULL;
 	ukfs = NULL;
 	fstype = fsdevice = NULL;
+	fflag = 0;
 	memset(&mntd, 0, sizeof(mntd));
 
 	ukfs_init();
@@ -135,6 +137,7 @@
 		case 'f':
 			if (fsdevice == NULL)
 				fsdevice = optarg;
+			fflag = 1;
 			break;
 		case 'o':
 			if (mntopts == NULL)
@@ -219,7 +222,11 @@
 				return NULL;
 			}
 		}
+	}
+	if (ukfs_part_probe(fsdevice, &mntd.mntd_part) == -1)
+		return NULL;
 
+	if (!fflag) {
 		build_alias_list();
 		alias = get_alias(fsdevice);
 		if (alias != NULL)
@@ -420,7 +427,7 @@
 #ifdef HAVE_UKFS_DISKLABEL
                 if (fs->fs_flags == 0) {
                         ukfs = ukfs_mount_disk(fs->fs_name,
-                            mntdp->mntd_canon_dev, ukfs_part_none,
+                            mntdp->mntd_canon_dev, mntdp->mntd_part,
 			    mntdp->mntd_canon_dir, mntdp->mntd_flags,
 			    fs->fs_args, fs->fs_args_size);
                 } else

Reply via email to