storage/posix: Set op_ret to -1 when open fails.

Thanks to Jeff Darcy <jdarcy@redhat.com> for
the bug report and the patch.

Signed-off-by: Vikas Gorur <vikas@gluster.com>
Signed-off-by: Anand V. Avati <avati@dev.gluster.com>

BUG: 581 (posix_open does not report open(2) failures correctly)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=581
This commit is contained in:
Vikas Gorur 2010-02-02 06:51:15 +00:00 committed by Anand V. Avati
parent 902422d4de
commit 8bcc534da4

View File

@ -2343,6 +2343,7 @@ posix_open (call_frame_t *frame, xlator_t *this,
_fd = open (real_path, flags, 0);
if (_fd == -1) {
op_ret = -1;
op_errno = errno;
gf_log (this->name, GF_LOG_ERROR,
"open on %s: %s", real_path, strerror (op_errno));