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.

66 lines
1.6 KiB

  1. From dbf03eb09bf1a41bcd140c4edba351121ac24729 Mon Sep 17 00:00:00 2001
  2. From: Michael Heimpold <mhei@heimpold.de>
  3. Date: Wed, 13 Jul 2016 00:36:46 +0200
  4. Subject: [PATCH 07/16] Replace ZEND_REGISTER_RESOURCE with
  5. zend_register_resource
  6. Signed-off-by: Michael Heimpold <mhei@heimpold.de>
  7. ---
  8. dio.c | 12 ++++++------
  9. 1 file changed, 6 insertions(+), 6 deletions(-)
  10. diff --git a/dio.c b/dio.c
  11. index 6b687ac..6f2d58c 100644
  12. --- a/dio.c
  13. +++ b/dio.c
  14. @@ -72,9 +72,9 @@ static int new_php_fd(php_fd_t **f, int fd)
  15. return 1;
  16. }
  17. -static void _dio_close_fd(zend_rsrc_list_entry *rsrc TSRMLS_DC)
  18. +static void _dio_close_fd(zend_resource *res)
  19. {
  20. - php_fd_t *f = (php_fd_t *) rsrc->ptr;
  21. + php_fd_t *f = (php_fd_t *)zend_fetch_resource(res, NULL, le_fd);
  22. if (f) {
  23. close(f->fd);
  24. free(f);
  25. @@ -115,7 +115,7 @@ PHP_FUNCTION(dio_open)
  26. RETURN_FALSE;
  27. }
  28. - ZEND_REGISTER_RESOURCE(return_value, f, le_fd);
  29. + RETVAL_RES(zend_register_resource(f, le_fd));
  30. }
  31. /* }}} */
  32. @@ -144,7 +144,7 @@ PHP_FUNCTION(dio_fdopen)
  33. RETURN_FALSE;
  34. }
  35. - ZEND_REGISTER_RESOURCE(return_value, f, le_fd);
  36. + RETVAL_RES(zend_register_resource(f, le_fd));
  37. }
  38. /* }}} */
  39. @@ -175,7 +175,7 @@ PHP_FUNCTION(dio_dup)
  40. RETURN_FALSE;
  41. }
  42. - ZEND_REGISTER_RESOURCE(return_value, df, le_fd);
  43. + RETVAL_RES(zend_register_resource(f, le_fd));
  44. }
  45. /* }}} */
  46. #endif
  47. @@ -434,7 +434,7 @@ PHP_FUNCTION(dio_fcntl)
  48. if (!new_php_fd(&new_f, fcntl(f->fd, cmd, Z_LVAL_P(arg)))) {
  49. RETURN_FALSE;
  50. }
  51. - ZEND_REGISTER_RESOURCE(return_value, new_f, le_fd);
  52. + RETVAL_RES(zend_register_resource(new_f, le_fd));
  53. break;
  54. }
  55. default:
  56. --
  57. 2.5.0