From 5d0813e0c9c65d8e4a12a6b86c6d2516098a2789 Mon Sep 17 00:00:00 2001 From: bjh21 Date: Thu, 6 Apr 2006 20:41:38 +0000 Subject: [PATCH] Use more manifest constants. --- sys/arch/acorn32/stand/lib/riscoscalls.h | 14 +++++++++++++- sys/arch/acorn32/stand/nbfs/nbfs.c | 18 ++++++------------ 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/sys/arch/acorn32/stand/lib/riscoscalls.h b/sys/arch/acorn32/stand/lib/riscoscalls.h index c662f35a66fb..26afeec48894 100644 --- a/sys/arch/acorn32/stand/lib/riscoscalls.h +++ b/sys/arch/acorn32/stand/lib/riscoscalls.h @@ -1,4 +1,4 @@ -/* $NetBSD: riscoscalls.h,v 1.5 2006/04/01 19:08:08 bjh21 Exp $ */ +/* $NetBSD: riscoscalls.h,v 1.6 2006/04/06 20:41:38 bjh21 Exp $ */ /*- * Copyright (c) 2001 Ben Harris @@ -299,6 +299,18 @@ extern os_error *xosmodule_lookup(char const *, int *, int *, void **, void **, #define fileswitch_NEEDS_CAT (1 << 1) #define fileswitch_NEEDS_EX (1 << 2) +#define fileswitch_NOT_FOUND 0 +#define fileswitch_IS_FILE 1 +#define fileswitch_IS_DIR 2 +#define fileswitch_IS_IMAGE 3 + +#define fileswitch_ATTR_OWNER_READ (1 << 0) +#define fileswitch_ATTR_OWNER_WRITE (1 << 1) +#define fileswitch_ATTR_OWNER_LOCKED (1 << 3) +#define fileswitch_ATTR_WORLD_READ (1 << 4) +#define fileswitch_ATTR_WORLD_WRITE (1 << 5) +#define fileswitch_ATTR_WORLD_LOCKED (1 << 7) + #ifndef __ASSEMBLER__ extern os_error *xosfscontrol_shutdown(void); #endif diff --git a/sys/arch/acorn32/stand/nbfs/nbfs.c b/sys/arch/acorn32/stand/nbfs/nbfs.c index 69219f66306a..b2540026e274 100644 --- a/sys/arch/acorn32/stand/nbfs/nbfs.c +++ b/sys/arch/acorn32/stand/nbfs/nbfs.c @@ -1,4 +1,4 @@ -/* $NetBSD: nbfs.c,v 1.1 2006/04/05 21:33:26 bjh21 Exp $ */ +/* $NetBSD: nbfs.c,v 1.2 2006/04/06 20:41:38 bjh21 Exp $ */ /*- * Copyright (c) 2006 Ben Harris @@ -239,17 +239,11 @@ nbfs_file(struct nbfs_reg *r) else { err = FS_STAT(f.f_ops)(&f, &st); if (err != 0) goto fail; - if (S_ISDIR(st.st_mode)) { - r->r0 = 2; - r->r2 = r->r3 = 0; - r->r4 = st.st_size; - r->r5 = 0x11; - } else { - r->r0 = 1; - r->r2 = r->r3 = 0; - r->r4 = st.st_size; - r->r5 = 0x11; - } + r->r0 = S_ISDIR(st.st_mode) ? + fileswitch_IS_DIR : fileswitch_IS_FILE; + r->r2 = r->r3 = 0; + r->r4 = st.st_size; + r->r5 = fileswitch_OWNER_READ | fileswitch_WORLD_READ; } break; default: