diff options
author | Jeremie Koenig <jk@jk.fr.eu.org> | 2010-08-23 11:33:22 +0000 |
---|---|---|
committer | Jeremie Koenig <jk@jk.fr.eu.org> | 2010-08-30 14:31:31 +0200 |
commit | 2f30d52e2753c4fc854753ee2d0efb895a317c9f (patch) | |
tree | fc8704aadad47a0373258e80a25cf8773110547e /netfs.c | |
parent | 0277bc261796743148769a3f76f9cae51c61e0a4 (diff) |
Detect asprintf's ENOMEM in procfs.c rather than everywhere
* procfs.h: Make CONTENTS_LEN an ssize_t rather than a size_t,
and document the change.
* procfs.c (procfs_get_contents): Initialize CONTENTS_LEN to a
negative value, and fail with ENOMEM if it's still negative after the
callback returns. (everywhere): Update to ssize_t.
* dircat.c, netfs.c, process.c,
procfs_dir.c, proclist.c, rootdir.c: Update to
ssize_t and the new GET_CONTENTS semantics.
Diffstat (limited to 'netfs.c')
-rw-r--r-- | netfs.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -30,7 +30,7 @@ int netfs_maxsymlinks = PROCFS_MAXSYMLINKS; error_t netfs_validate_stat (struct node *np, struct iouser *cred) { char *contents; - size_t contents_len; + ssize_t contents_len; error_t err; /* Only symlinks need to have their size filled, before a read is @@ -54,7 +54,7 @@ error_t netfs_attempt_read (struct iouser *cred, struct node *np, loff_t offset, size_t *len, void *data) { char *contents; - size_t contents_len; + ssize_t contents_len; error_t err; err = procfs_get_contents (np, &contents, &contents_len); @@ -79,7 +79,7 @@ error_t netfs_attempt_readlink (struct iouser *user, struct node *np, char *buf) { char *contents; - size_t contents_len; + ssize_t contents_len; error_t err; err = procfs_get_contents (np, &contents, &contents_len); @@ -137,7 +137,7 @@ error_t netfs_get_dirents (struct iouser *cred, struct node *dir, vm_size_t bufsize, int *amt) { char *contents; - size_t contents_len; + ssize_t contents_len; error_t err; err = procfs_get_contents (dir, &contents, &contents_len); |