summaryrefslogtreecommitdiff
path: root/procfs.h
diff options
context:
space:
mode:
authorJeremie Koenig <jk@jk.fr.eu.org>2010-08-17 16:48:55 +0000
committerJeremie Koenig <jk@jk.fr.eu.org>2010-08-30 14:14:48 +0200
commitac75e3648e6a9c3a8cf45d5fa491abd3a3ab3613 (patch)
tree42afd9455d4384b82a70625ec8b7194d4a08efda /procfs.h
parent3907bbbcfb806799a5349e46a2b804307a0e9836 (diff)
Fix the failure semantics of procfs_make_node
* procfs.c (procfs_make_node): Invoke the cleanup callback on failure, so that callers don't have to. * procfs.h: Document the change. * procfs_dir.c (procfs_dir_make_node), procfs_file.c (procfs_file_make_node), proclist.c (proclist_make_node): Update to reflect the change.
Diffstat (limited to 'procfs.h')
-rw-r--r--procfs.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/procfs.h b/procfs.h
index 0557b6d..21b0f93 100644
--- a/procfs.h
+++ b/procfs.h
@@ -29,6 +29,8 @@ struct procfs_node_ops
void (*cleanup) (void *hook);
};
+/* Create a new node and return it. Returns NULL if it fails to allocate
+ enough memory. In this case, ops->cleanup will be invoked. */
struct node *procfs_make_node (const struct procfs_node_ops *ops, void *hook);