You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

42 lines
1.1 KiB

  1. From 1e6f98d9fb65b9c052e6d555eab573d7e5073dae Mon Sep 17 00:00:00 2001
  2. From: remi <remi@c90b9560-bf6c-de11-be94-00142212c4b1>
  3. Date: Wed, 9 Oct 2013 12:24:28 +0000
  4. Subject: [PATCH 04/16] Fix last build warning [-Wunused-but-set-variable]
  5. (sorry for legibility...)
  6. git-svn-id: http://svn.php.net/repository/pecl/dio/trunk@331751 c90b9560-bf6c-de11-be94-00142212c4b1
  7. ---
  8. dio_posix.c | 7 ++++++-
  9. 1 file changed, 6 insertions(+), 1 deletion(-)
  10. diff --git a/dio_posix.c b/dio_posix.c
  11. index 01e1109..6ed8630 100644
  12. --- a/dio_posix.c
  13. +++ b/dio_posix.c
  14. @@ -28,7 +28,10 @@
  15. * Convert an fopen() mode string to open() flags
  16. */
  17. static int dio_stream_mode_to_flags(const char *mode) {
  18. - int flags = 0, ch = 0, bin = 1;
  19. + int flags = 0, ch = 0;
  20. +#if defined(_O_TEXT) && defined(O_BINARY)
  21. + int bin = 1;
  22. +#endif
  23. switch(mode[ch++]) {
  24. case 'r':
  25. @@ -45,9 +48,11 @@ static int dio_stream_mode_to_flags(const char *mode) {
  26. break;
  27. }
  28. +#if defined(_O_TEXT) && defined(O_BINARY)
  29. if (mode[ch] != '+') {
  30. bin = (mode[ch++] == 'b');
  31. }
  32. +#endif
  33. if (mode[ch] == '+') {
  34. flags |= O_RDWR;
  35. --
  36. 2.5.0