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_FileDesc2NativeHandle(PRFileDesc *fd)
{
if (fd) {
/*
* The fd may be layered. Chase the links to the
* bottom layer to get the osfd.
*/
PRFileDesc *bottom = fd;
while (bottom->lower != NULL) {
bottom = bottom->lower;
}
return bottom->secret->md.osfd;
} else {
PR_SetError(PR_INVALID_ARGUMENT_ERROR, 0);
return -1;
}
if (fd) {
fd = PR_GetIdentitiesLayer(fd, PR_NSPR_IO_LAYER);
}
if (!fd) {
PR_SetError(PR_INVALID_ARGUMENT_ERROR, 0);
return -1;
}
return fd->secret->md.osfd;
}
PR_IMPLEMENT(void)