summaryrefslogtreecommitdiff
path: root/tmpfs
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>2002-06-02 21:41:20 +0000
committerRoland McGrath <roland@gnu.org>2002-06-02 21:41:20 +0000
commitedcd079fa2e831825f93378364f0ecf025e4c876 (patch)
tree3ebbe9bc952e25fb835a0c70df5181e54f514537 /tmpfs
parentb53c9c8b82b63b06ae3f6d337feebf8d53656bb0 (diff)
2002-05-29 Roland McGrath <roland@frob.com>
* node.c (diskfs_S_file_get_storage_info): Return a null port when the peropen is not open for read/write. Set STORE_READONLY if O_WRITE set.
Diffstat (limited to 'tmpfs')
-rw-r--r--tmpfs/node.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/tmpfs/node.c b/tmpfs/node.c
index 934b6797..4e0d0d53 100644
--- a/tmpfs/node.c
+++ b/tmpfs/node.c
@@ -559,7 +559,8 @@ diskfs_S_file_get_storage_info (struct protid *cred,
assert (*num_ports >= 1); /* mig always gives us some */
*num_ports = 1;
*ports_type = MACH_MSG_TYPE_MOVE_SEND;
- (*ports)[0] = memobj;
+ (*ports)[0]
+ = (cred->po->openstat & O_RDWR) == O_RDWR ? memobj : MACH_PORT_NULL;
assert (*num_offsets >= 2); /* mig always gives us some */
*num_offsets = 2;
@@ -569,8 +570,7 @@ diskfs_S_file_get_storage_info (struct protid *cred,
assert (*num_ints >= 6); /* mig always gives us some */
*num_ints = 6;
(*ints)[0] = STORAGE_MEMORY;
- (*ints)[1] = (((cred->po->openstat & O_RDWR) == O_READ)
- ? STORE_READONLY : 0);
+ (*ints)[1] = (cred->po->openstat & O_WRITE) ? 0 : STORE_READONLY;
(*ints)[2] = 1; /* block size */
(*ints)[3] = 1; /* 1 run in offsets list */
(*ints)[4] = 0; /* name len */