diff options
author | David Smith <dsmith@redhat.com> | 2009-05-22 10:50:30 -0500 |
---|---|---|
committer | David Smith <dsmith@redhat.com> | 2009-05-22 10:50:30 -0500 |
commit | e57421f400d17786c1fdbead5fbca27a1fbe4ec5 (patch) | |
tree | daefda43d0be0bbf3552d45101693cc07c480a14 /runtime/transport/transport.c | |
parent | c8e9eb18d8d13d099a4a177fe53de507c1d9ce8b (diff) | |
download | systemtap-steved-e57421f400d17786c1fdbead5fbca27a1fbe4ec5.tar.gz systemtap-steved-e57421f400d17786c1fdbead5fbca27a1fbe4ec5.tar.xz systemtap-steved-e57421f400d17786c1fdbead5fbca27a1fbe4ec5.zip |
Added error checking and other updates.
* runtime/vsprintf.c: Added transport.h inclusion for STP_BUFFER_SIZE
definition.
* runtime/transport/debugfs.c (_stp_register_ctl_channel_fs): Added error
checking.
* runtime/transport/transport.c (_stp_get_root_dir): Ditto.
(_stp_transport_fs_init): Added original transport support and error
checking.
* runtime/transport/relay_v2.c (__stp_relay_create_buf_file_callback):
Added error checking.
(_stp_transport_data_fs_init): Ditto.
* runtime/transport/ring_buffer.c (_stp_transport_data_fs_init): Ditto.
* runtime/transport/utt.c: Removed unused file.
* runtime/transport/utt.h: Ditto.
Diffstat (limited to 'runtime/transport/transport.c')
-rw-r--r-- | runtime/transport/transport.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/runtime/transport/transport.c b/runtime/transport/transport.c index 792ea815..ab0806f2 100644 --- a/runtime/transport/transport.c +++ b/runtime/transport/transport.c @@ -453,6 +453,12 @@ static struct dentry *_stp_get_root_dir(void) errk("Could not create or find transport directory.\n"); } } + else if (IS_ERR(__stp_root_dir)) { + __stp_root_dir = NULL; + errk("Could not create root directory \"%s\", error %ld\n", name, + -PTR_ERR(__stp_root_dir)); + } + _stp_unlock_transport_dir(); return __stp_root_dir; } @@ -490,8 +496,20 @@ static int _stp_transport_fs_init(const char *module_name) if (root_dir == NULL) return -1; +#if STP_TRANSPORT_VERSION == 1 + __stp_module_dir = relayfs_create_dir(module_name, root_dir); +#else __stp_module_dir = debugfs_create_dir(module_name, root_dir); +#endif if (!__stp_module_dir) { + errk("Could not create module directory \"%s\"\n", + module_name); + _stp_remove_root_dir(); + return -1; + } + else if (IS_ERR(__stp_module_dir)) { + errk("Could not create module directory \"%s\", error %ld\n", + module_name, -PTR_ERR(__stp_module_dir)); _stp_remove_root_dir(); return -1; } |