diff options
| author | Gustavo André dos Santos Lopes <cataphract@php.net> | 2011-03-17 22:21:59 +0000 |
|---|---|---|
| committer | Gustavo André dos Santos Lopes <cataphract@php.net> | 2011-03-17 22:21:59 +0000 |
| commit | ff0fe17725d4f2de6caa1ec3abd1e780e3474e61 (patch) | |
| tree | 07a1d648b4ba34e7c1d9bca719f5b90984faf7d8 /ext | |
| parent | afdcb5ecb422807c7472d83574b7acf223f665e4 (diff) | |
| download | php-git-ff0fe17725d4f2de6caa1ec3abd1e780e3474e61.tar.gz | |
- Replaced calls to getprotobyname by constants to avoid
unnecessarily hitting /etc/protocols on MINIT.
Diffstat (limited to 'ext')
| -rw-r--r-- | ext/sockets/sockets.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/ext/sockets/sockets.c b/ext/sockets/sockets.c index a180c86c6e..421e01c9ae 100644 --- a/ext/sockets/sockets.c +++ b/ext/sockets/sockets.c @@ -815,14 +815,9 @@ PHP_MINIT_FUNCTION(sockets) #if HAVE_IPV6 REGISTER_LONG_CONSTANT("IPPROTO_IPV6", IPPROTO_IPV6, CONST_CS | CONST_PERSISTENT); #endif - - if ((pe = getprotobyname("tcp"))) { - REGISTER_LONG_CONSTANT("SOL_TCP", pe->p_proto, CONST_CS | CONST_PERSISTENT); - } - if ((pe = getprotobyname("udp"))) { - REGISTER_LONG_CONSTANT("SOL_UDP", pe->p_proto, CONST_CS | CONST_PERSISTENT); - } + REGISTER_LONG_CONSTANT("SOL_TCP", IPPROTO_TCP, CONST_CS | CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("SOL_UDP", IPPROTO_UDP, CONST_CS | CONST_PERSISTENT); return SUCCESS; } |
