From 07f1524165f864e09033b7f78e921c5375d4e2d6 Mon Sep 17 00:00:00 2001 From: Shehjar Tikoo Date: Tue, 21 Apr 2009 04:50:33 -0700 Subject: 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 --- xlators/storage/posix/src/posix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'xlators/storage/posix/src/posix.c') 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; -- cgit