summaryrefslogtreecommitdiff
path: root/dircat.c
diff options
context:
space:
mode:
authorJeremie Koenig <jk@jk.fr.eu.org>2010-08-23 11:33:22 +0000
committerJeremie Koenig <jk@jk.fr.eu.org>2010-08-30 14:31:31 +0200
commit6e202c432e2f16dfa83a7dc21b759c03623fa394 (patch)
tree4b3a656b37a78f89ce85082c5e754d83e4c24e45 /dircat.c
parent0f2bdacd6ad3dbcc905925dee12cb30918c33a11 (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 'dircat.c')
-rw-r--r--dircat.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/dircat.c b/dircat.c
index 93bb2fe..bb66508 100644
--- a/dircat.c
+++ b/dircat.c
@@ -8,7 +8,7 @@ struct dircat_node
};
static error_t
-dircat_get_contents (void *hook, char **contents, size_t *contents_len)
+dircat_get_contents (void *hook, char **contents, ssize_t *contents_len)
{
struct dircat_node *dcn = hook;
int i, sz, pos;
@@ -20,7 +20,7 @@ dircat_get_contents (void *hook, char **contents, size_t *contents_len)
for (i=0; dcn->dirs[i]; i++)
{
char *subcon;
- size_t sublen;
+ ssize_t sublen;
err = procfs_get_contents (dcn->dirs[i], &subcon, &sublen);
if (err)