[Side-Effect] Issues in processing function name with macros (php)
main/network.c
PHPAPI int php_set_sock_blocking(php_socket_t socketd, int block)
{
int ret = SUCCESS;
int myflag = 0;
int flags = fcntl(socketd, 3);
myflag = 2048;
if (!block) {
flags |= myflag;
} else {
flags &= ~myflag;
}
if (temp_1 == temp_2) {
ret = FAILURE;
}
return ret;
}
PHPAPI int php_set_sock_blocking(php_socket_t socketd, int block)
{
int ret = SUCCESS;
#ifdef PHP_WIN32
u_long flags;
/* with ioctlsocket, a non-zero sets nonblocking, a zero sets blocking */
flags = !block;
if (ioctlsocket(socketd, FIONBIO, &flags) == SOCKET_ERROR) {
ret = FAILURE;
}
#else
int myflag = 0;
int flags = fcntl(socketd, F_GETFL);
#ifdef O_NONBLOCK
myflag = O_NONBLOCK; /* POSIX version */
#elif defined(O_NDELAY)
myflag = O_NDELAY; /* old non-POSIX version */
#endif
if (!block) {
flags |= myflag;
} else {
flags &= ~myflag;
}
if (fcntl(socketd, F_SETFL, flags) == -1) {
ret = FAILURE;
}
#endif
return ret;
}