|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #62188 Possible typo in errno check in dio_fdopen()
Submitted: 2012-05-30 09:34 UTC Modified: 2012-06-30 22:57 UTC
From: daniel dot mueller at inexio dot net Assigned: cyberspice (profile)
Status: Closed Package: dio (PECL)
PHP Version: Irrelevant OS: FreeBSD 7.2
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: daniel dot mueller at inexio dot net
New email:
PHP Version: OS:


 [2012-05-30 09:34 UTC] daniel dot mueller at inexio dot net
In dio_fdopen() the errno is checked against "EBADFD".

The effect is following:

1) Compile under FreeBSD fails, because this macro doesn't exist.

2) Under Linux there  are two Macros:
 #define	EBADFD		77	/* File descriptor in bad state */
 #define	EBADF		 9	/* Bad file number */

 The check has probally not the desired effect in the case of a bad file number.

I have added a patch, which checks against "EBADF" insteat of "EBADFD"

This affects Version 0.0.5 of the dio extension.


Test script:


Expected result:
Warning: dio_fdopen(): Bad file descriptor -1 in /home/dm/dio-test.php on line 5

Actual result:
FreeBSD: compile of extension fails.

resource(4) of type (Direct I/O File Descriptor)


patch-error-checking.diff (last revision 2012-05-30 09:35 UTC by daniel dot mueller at inexio dot net)

Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2012-06-12 00:31 UTC]
-Status: Open +Status: Assigned -Assigned To: +Assigned To: cyberspice
 [2012-06-30 22:57 UTC]
Fixed in 0.0.6
 [2012-06-30 22:57 UTC]
-Status: Assigned +Status: Closed
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Mar 02 02:01:28 2024 UTC