Skip to content

Commit c39f71b

Browse files
committed
Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0: Fixed #72974 imap is undefined service on AIX
2 parents 3b8dc33 + b8215c0 commit c39f71b

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

ext/standard/basic_functions.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5606,6 +5606,15 @@ PHP_FUNCTION(getservbyname)
56065606

56075607
serv = getservbyname(name, proto);
56085608

5609+
#if defined(_AIX)
5610+
/*
5611+
On AIX, imap is only known as imap2 in /etc/services, while on Linux imap is an alias for imap2.
5612+
If a request for imap gives no result, we try again with imap2.
5613+
*/
5614+
if (serv == NULL && strcmp(name, "imap") == 0) {
5615+
serv = getservbyname("imap2", proto);
5616+
}
5617+
#endif
56095618
if (serv == NULL) {
56105619
RETURN_FALSE;
56115620
}

0 commit comments

Comments
 (0)