Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.sbin/makefs/msdos - don't forget to set de_pmp
details: https://anonhg.NetBSD.org/src/rev/d0bf4a2c2e10
branches: trunk
changeset: 784405:d0bf4a2c2e10
user: christos <christos%NetBSD.org@localhost>
date: Sun Jan 27 22:52:19 2013 +0000
description:
- don't forget to set de_pmp
- unexpand inserted tabs to the "." and ".." strings!
diffstat:
usr.sbin/makefs/msdos/msdosfs_vnops.c | 13 ++++++++-----
1 files changed, 8 insertions(+), 5 deletions(-)
diffs (69 lines):
diff -r 88955a9e1dd3 -r d0bf4a2c2e10 usr.sbin/makefs/msdos/msdosfs_vnops.c
--- a/usr.sbin/makefs/msdos/msdosfs_vnops.c Sun Jan 27 22:09:24 2013 +0000
+++ b/usr.sbin/makefs/msdos/msdosfs_vnops.c Sun Jan 27 22:52:19 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: msdosfs_vnops.c,v 1.11 2013/01/27 22:09:24 christos Exp $ */
+/* $NetBSD: msdosfs_vnops.c,v 1.12 2013/01/27 22:52:19 christos Exp $ */
/*-
* Copyright (C) 1994, 1995, 1997 Wolfgang Solfrank.
@@ -51,7 +51,7 @@
#endif
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: msdosfs_vnops.c,v 1.11 2013/01/27 22:09:24 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: msdosfs_vnops.c,v 1.12 2013/01/27 22:52:19 christos Exp $");
#include <sys/param.h>
#include <sys/mman.h>
@@ -146,6 +146,7 @@
int olddos = 1;
pmp = dp->de_pmp;
+
switch (unix2dosfn((const u_char *)cnp->cn_nameptr, dosfilename,
cnp->cn_namelen, 0)) {
case 0:
@@ -498,7 +499,7 @@
struct direntry dot;
struct direntry dotdot;
} dosdirtemplate = {
- { ". ", " ", /* the . entry */
+ { ". ", " ", /* the . entry */
ATTR_DIRECTORY, /* file attribute */
0, /* reserved */
0, { 0, 0 }, { 0, 0 }, /* create time & date */
@@ -508,7 +509,7 @@
{ 0, 0 }, /* startcluster */
{ 0, 0, 0, 0 } /* filesize */
},
- { ".. ", " ", /* the .. entry */
+ { ".. ", " ", /* the .. entry */
ATTR_DIRECTORY, /* file attribute */
0, /* reserved */
0, { 0, 0 }, { 0, 0 }, /* create time & date */
@@ -553,7 +554,6 @@
if (error)
goto bad2;
- DPRINTF(("%s(newcluster %lu)\n", __func__, newcluster));
memset(&ndirent, 0, sizeof(ndirent));
ndirent.de_pmp = pmp;
ndirent.de_flag = DE_ACCESS | DE_CREATE | DE_UPDATE;
@@ -581,6 +581,8 @@
putushort(denp[0].deMDate, ndirent.de_MDate);
putushort(denp[0].deMTime, ndirent.de_MTime);
pcl = pdep->de_StartCluster;
+ DPRINTF(("%s(pcl %lu, rootdirblk=%lu)\n", __func__, pcl,
+ pmp->pm_rootdirblk));
if (FAT32(pmp) && pcl == pmp->pm_rootdirblk)
pcl = 0;
putushort(denp[1].deStartCluster, pcl);
@@ -614,6 +616,7 @@
ndirent.de_FileSize = 0;
ndirent.de_dev = pdep->de_dev;
ndirent.de_devvp = pdep->de_devvp;
+ ndirent.de_pmp = pdep->de_pmp;
if ((error = msdosfs_findslot(pdep, &cn)) != 0)
goto bad;
if ((error = createde(&ndirent, pdep, &dep, &cn)) != 0)
Home |
Main Index |
Thread Index |
Old Index