/* no need to destroy/free zres -- it's NULL in this circumstance */
assert(zres == NULL);
}
+ RETVAL_LONG((zend_long)res);
} else {
SOCKETS_G(last_error) = errno;
- php_error_docref(NULL, E_WARNING, "error in recvmsg [%d]: %s",
+ php_error_docref(NULL, E_WARNING, "Error in recvmsg [%d]: %s",
errno, sockets_strerror(errno));
- RETURN_FALSE;
+ RETVAL_FALSE;
}
- RETURN_LONG((zend_long)res);
+ allocations_dispose(&allocations);
}
PHP_FUNCTION(socket_cmsg_space)
--- /dev/null
-Warning: socket_recvmsg(): error in recvmsg [%d]: %a in %s on line %d
+ --TEST--
+ Error during socket_sendmsg() or socket_recvmsg()
+ --FILE--
+ <?php
+
+ $socket = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP);
+ socket_sendmsg($socket, [], -1);
+ $message = ['controllen' => 1];
+ socket_recvmsg($socket, $message, -1);
+
+ ?>
+ --EXPECTF--
+ Warning: socket_sendmsg(): error in sendmsg [%d]: %a in %s on line %d
+
++Warning: socket_recvmsg(): Error in recvmsg [%d]: %a in %s on line %d