diff options
author | Frank Ch. Eigler <fche@elastic.org> | 2009-10-13 17:33:29 -0400 |
---|---|---|
committer | Frank Ch. Eigler <fche@elastic.org> | 2009-10-13 17:33:29 -0400 |
commit | c4ca2da6ca875c0142a4e7ffd95e0aa0c573590b (patch) | |
tree | 5af1c8dec7cb959c003f8fad83908013d7ac4390 /runtime/transport | |
parent | 784a7d570306d7601a7338c95226a49dec156398 (diff) | |
download | systemtap-steved-c4ca2da6ca875c0142a4e7ffd95e0aa0c573590b.tar.gz systemtap-steved-c4ca2da6ca875c0142a4e7ffd95e0aa0c573590b.tar.xz systemtap-steved-c4ca2da6ca875c0142a4e7ffd95e0aa0c573590b.zip |
runtime shutdown errors: simplify, improve error specificity
* transport/control.c (*_cmd): Return -Ecodes rather than "-1" from
file_operations callbacks.
* staprun/ctl.c (init_ctl_channel): Return distinct error codes.
* staprun/staprun.c (remove_module): Skip connection attempt to .ctl
file; just do delete_module() with O_NONBLOCK.
Diffstat (limited to 'runtime/transport')
-rw-r--r-- | runtime/transport/control.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/runtime/transport/control.c b/runtime/transport/control.c index 0e18bb8b..8712a8ad 100644 --- a/runtime/transport/control.c +++ b/runtime/transport/control.c @@ -59,7 +59,7 @@ static ssize_t _stp_ctl_write_cmd(struct file *file, const char __user *buf, siz #ifdef STP_BULKMODE return count; #else - return -1; + return -EINVAL; #endif case STP_RELOCATION: _stp_do_relocation (buf, count); @@ -150,7 +150,7 @@ static int _stp_ctl_write(int type, void *data, unsigned len) /* get a buffer from the free pool */ bptr = _stp_mempool_alloc(_stp_pool_q); if (unlikely(bptr == NULL)) - return -1; + return -ENOMEM; bptr->type = type; memcpy(bptr->buf, data, len); @@ -225,7 +225,7 @@ static ssize_t _stp_ctl_read_cmd(struct file *file, char __user *buf, static int _stp_ctl_open_cmd(struct inode *inode, struct file *file) { if (_stp_ctl_attached) - return -1; + return -EBUSY; _stp_attach(); return 0; } |