summaryrefslogtreecommitdiffstats
path: root/xlators/storage
diff options
context:
space:
mode:
authorShehjar Tikoo <shehjart@zresearch.com>2009-04-21 04:50:33 -0700
committerAnand V. Avati <avati@amp.gluster.com>2009-04-22 13:06:31 +0530
commit07f1524165f864e09033b7f78e921c5375d4e2d6 (patch)
tree5cf891173e40578e23c41f53de4deb250d399085 /xlators/storage
parent27e1c9fbd3fb6eda4f7d64ff04dad9d306c237e7 (diff)
posix: Ensure EINVAL return on NULL args
Initing op_errno to EINVAL ensures that this is the value that gets returned on STACK_UNWIND, in case any of the VALIDATE macros result in exit from "out" due to a NULL argument. If this is not done , we get op_ret as -1 with errno set to 0 in the application's syscall. Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
Diffstat (limited to 'xlators/storage')
-rw-r--r--xlators/storage/posix/src/posix.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/xlators/storage/posix/src/posix.c b/xlators/storage/posix/src/posix.c
index 65579ee12..4c716dad9 100644
--- a/xlators/storage/posix/src/posix.c
+++ b/xlators/storage/posix/src/posix.c
@@ -357,7 +357,7 @@ posix_opendir (call_frame_t *frame, xlator_t *this,
{
char * real_path = NULL;
int32_t op_ret = -1;
- int32_t op_errno = 0;
+ int32_t op_errno = EINVAL;
DIR * dir = NULL;
struct posix_fd * pfd = NULL;