Bugzilla bug 110868: PR_FileDesc2NativeHandle should look for the NSPR

layer as opposed to assuming the bottom layer is the NSPR layer.
This commit is contained in:
wtc%netscape.com 2001-12-27 02:19:31 +00:00
Родитель d8d667f958
Коммит 4b0b1b4767
1 изменённых файлов: 8 добавлений и 14 удалений

Просмотреть файл

@ -1539,20 +1539,14 @@ failed:
PR_IMPLEMENT(PRInt32) PR_IMPLEMENT(PRInt32)
PR_FileDesc2NativeHandle(PRFileDesc *fd) PR_FileDesc2NativeHandle(PRFileDesc *fd)
{ {
if (fd) { if (fd) {
/* fd = PR_GetIdentitiesLayer(fd, PR_NSPR_IO_LAYER);
* The fd may be layered. Chase the links to the }
* bottom layer to get the osfd. if (!fd) {
*/ PR_SetError(PR_INVALID_ARGUMENT_ERROR, 0);
PRFileDesc *bottom = fd; return -1;
while (bottom->lower != NULL) { }
bottom = bottom->lower; return fd->secret->md.osfd;
}
return bottom->secret->md.osfd;
} else {
PR_SetError(PR_INVALID_ARGUMENT_ERROR, 0);
return -1;
}
} }
PR_IMPLEMENT(void) PR_IMPLEMENT(void)