[svn-commits] tilghman: branch 1.8 r363209 - /branches/1.8/main/astfd.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Mon Apr 23 11:02:32 CDT 2012


Author: tilghman
Date: Mon Apr 23 11:02:28 2012
New Revision: 363209

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=363209
Log:
On some platforms, O_RDONLY is not a flag to be checked, but merely the absence of O_RDWR and O_WRONLY.

The POSIX specification does not mandate how these 3 flags must be specified,
only that one of the three must be specified in every call.

Modified:
    branches/1.8/main/astfd.c

Modified: branches/1.8/main/astfd.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/main/astfd.c?view=diff&rev=363209&r1=363208&r2=363209
==============================================================================
--- branches/1.8/main/astfd.c (original)
+++ branches/1.8/main/astfd.c Mon Apr 23 11:02:28 2012
@@ -95,7 +95,11 @@
 				flags & O_NONBLOCK ? "|O_NONBLOCK" : "",
 				flags & O_TRUNC ? "|O_TRUNC" : "",
 				flags & O_RDWR ? "|O_RDWR" : "",
+#if O_RDONLY == 0
+				!(flags & (O_WRONLY | O_RDWR)) ? "|O_RDONLY" : "",
+#else
 				flags & O_RDONLY ? "|O_RDONLY" : "",
+#endif
 				flags & O_WRONLY ? "|O_WRONLY" : "",
 				"");
 			flags &= ~(O_CREAT | O_APPEND | O_EXCL | O_NONBLOCK | O_TRUNC | O_RDWR | O_RDONLY | O_WRONLY);




More information about the svn-commits mailing list