Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/fs/msdosfs - split a long line.
details: https://anonhg.NetBSD.org/src/rev/bc0b9e31d2ac
branches: trunk
changeset: 343391:bc0b9e31d2ac
user: christos <christos%NetBSD.org@localhost>
date: Mon Feb 01 16:53:23 2016 +0000
description:
- split a long line.
- remove extra test.
- move d_namlen setting to msdosfs_vnops.c to avoid the ifdef.
diffstat:
sys/fs/msdosfs/msdosfs_conv.c | 13 +++++--------
sys/fs/msdosfs/msdosfs_vnops.c | 6 ++++--
2 files changed, 9 insertions(+), 10 deletions(-)
diffs (69 lines):
diff -r 04fde9c91131 -r bc0b9e31d2ac sys/fs/msdosfs/msdosfs_conv.c
--- a/sys/fs/msdosfs/msdosfs_conv.c Mon Feb 01 16:47:00 2016 +0000
+++ b/sys/fs/msdosfs/msdosfs_conv.c Mon Feb 01 16:53:23 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: msdosfs_conv.c,v 1.13 2016/02/01 10:37:57 martin Exp $ */
+/* $NetBSD: msdosfs_conv.c,v 1.14 2016/02/01 16:53:23 christos Exp $ */
/*-
* Copyright (C) 1995, 1997 Wolfgang Solfrank.
@@ -62,7 +62,7 @@
#endif
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: msdosfs_conv.c,v 1.13 2016/02/01 10:37:57 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: msdosfs_conv.c,v 1.14 2016/02/01 16:53:23 christos Exp $");
/*
* System include files.
@@ -1590,9 +1590,10 @@
/*
* Translate ucs-2 to UNIX name
*/
- len = utf8 ? ucs2utf8str(wn, WIN_CHARS, buf, sizeof(buf)) : ucs2char8str(wn, WIN_CHARS, buf, sizeof(buf));
+ len = utf8 ? ucs2utf8str(wn, WIN_CHARS, buf, sizeof(buf))
+ : ucs2char8str(wn, WIN_CHARS, buf, sizeof(buf));
- if (len < 0 || (size_t)len > sizeof(dp->d_name) - 1)
+ if ((size_t)len > sizeof(dp->d_name) - 1)
return -1;
/*
@@ -1612,10 +1613,6 @@
memmove(&dp->d_name[len], &dp->d_name[0], *namlen - len);
memcpy(dp->d_name, buf, len);
-#ifdef __NetBSD__
- dp->d_namlen = *namlen;
-#endif
-
return chksum;
}
diff -r 04fde9c91131 -r bc0b9e31d2ac sys/fs/msdosfs/msdosfs_vnops.c
--- a/sys/fs/msdosfs/msdosfs_vnops.c Mon Feb 01 16:47:00 2016 +0000
+++ b/sys/fs/msdosfs/msdosfs_vnops.c Mon Feb 01 16:53:23 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: msdosfs_vnops.c,v 1.95 2016/02/01 02:59:33 christos Exp $ */
+/* $NetBSD: msdosfs_vnops.c,v 1.96 2016/02/01 16:53:23 christos Exp $ */
/*-
* Copyright (C) 1994, 1995, 1997 Wolfgang Solfrank.
@@ -48,7 +48,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: msdosfs_vnops.c,v 1.95 2016/02/01 02:59:33 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: msdosfs_vnops.c,v 1.96 2016/02/01 16:53:23 christos Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -1544,6 +1544,8 @@
chksum = win2unixfn((struct winentry *)dentp,
dirbuf, chksum, &namlen,
pmp->pm_flags & MSDOSFSMNT_UTF8);
+ if (chksum != -1)
+ dirbuf->d_namlen = namlen;
continue;
}
Home |
Main Index |
Thread Index |
Old Index