Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.bin/fstat set mode accordingly to file type (similarily ...
details: https://anonhg.NetBSD.org/src/rev/4da541ff71fe
branches: trunk
changeset: 481723:4da541ff71fe
user: jdolecek <jdolecek%NetBSD.org@localhost>
date: Fri Feb 04 10:13:54 2000 +0000
description:
set mode accordingly to file type (similarily to what nfs_filestat() does)
file type is now viewed correctly for files on ntfs
diffstat:
usr.bin/fstat/ntfs.c | 18 +++++++++++++++---
1 files changed, 15 insertions(+), 3 deletions(-)
diffs (46 lines):
diff -r 0d00bfaca4c9 -r 4da541ff71fe usr.bin/fstat/ntfs.c
--- a/usr.bin/fstat/ntfs.c Fri Feb 04 09:45:34 2000 +0000
+++ b/usr.bin/fstat/ntfs.c Fri Feb 04 10:13:54 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ntfs.c,v 1.3 1999/11/01 19:56:20 jdolecek Exp $ */
+/* $NetBSD: ntfs.c,v 1.4 2000/02/04 10:13:54 jdolecek Exp $ */
/*-
* Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
-__RCSID("$NetBSD: ntfs.c,v 1.3 1999/11/01 19:56:20 jdolecek Exp $");
+__RCSID("$NetBSD: ntfs.c,v 1.4 2000/02/04 10:13:54 jdolecek Exp $");
#include <sys/param.h>
#include <sys/time.h>
@@ -64,6 +64,7 @@
struct ntnode ntnode;
struct fnode fn;
struct ntfsmount ntm;
+ mode_t mode;
/* to get the ntnode, we have to go in two steps - firstly
* to read appropriate struct fnode and then getting the address
@@ -84,7 +85,18 @@
fsp->fsid = ntnode.i_dev & 0xffff;
fsp->fileid = (long)ntnode.i_number;
- fsp->mode = (mode_t)ntm.ntm_mode;
+ mode = (mode_t)ntm.ntm_mode;
+ switch (vp->v_type) {
+ case VREG:
+ mode |= S_IFREG;
+ break;
+ case VDIR:
+ mode |= S_IFDIR;
+ break;
+ default:
+ break;
+ }
+ fsp->mode = mode;
fsp->size = fn.f_size;
fsp->rdev = 0; /* XXX */
return 1;
Home |
Main Index |
Thread Index |
Old Index