diff options
author | Sergey Bugaev <bugaevc@gmail.com> | 2023-05-09 00:31:18 +0300 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2023-05-10 02:36:50 +0200 |
commit | a8b6031e712ad78e2ae5ebe3a09c8de0991e2f7b (patch) | |
tree | b256ba17eaa285c4493ac1f29ae613224b3da8b0 /storeio | |
parent | 206b0ed00489ab1f46ab4b3e643f226eef79176a (diff) | |
download | hurd-a8b6031e712ad78e2ae5ebe3a09c8de0991e2f7b.tar.gz hurd-a8b6031e712ad78e2ae5ebe3a09c8de0991e2f7b.tar.bz2 hurd-a8b6031e712ad78e2ae5ebe3a09c8de0991e2f7b.zip |
storeio: Port to x86_64
Message-Id: <20230508213136.608575-24-bugaevc@gmail.com>
Diffstat (limited to 'storeio')
-rw-r--r-- | storeio/io.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/storeio/io.c b/storeio/io.c index 3c4cb9ff..f01e1918 100644 --- a/storeio/io.c +++ b/storeio/io.c @@ -86,13 +86,20 @@ trivfs_S_io_read (struct trivfs_protid *cred, data_t *data, mach_msg_type_name_t *data_len, off_t offs, vm_size_t amount) { + error_t err; + size_t data_size = *data_len; + if (! cred) return EOPNOTSUPP; else if (! (cred->po->openmodes & O_READ)) return EBADF; - else - return open_read ((struct open *)cred->po->hook, - offs, amount, (void **)data, data_len); + + err = open_read ((struct open *)cred->po->hook, + offs, amount, (void **)data, &data_size); + if (err) + return err; + *data_len = data_size; + return 0; } /* Tell how much data can be read from the object without blocking for |