summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwtchang%redhat.com <devnull@localhost>2005-01-25 19:59:34 +0000
committerwtchang%redhat.com <devnull@localhost>2005-01-25 19:59:34 +0000
commit695b707f70a35545f5e81c85373c13a9d3445ed3 (patch)
treed62a8af583150156edd5f5484e44ccfa0c8eb315
parenta73e0a99207358ee52eb725620c8001363f0b343 (diff)
downloadnspr-hg-695b707f70a35545f5e81c85373c13a9d3445ed3.tar.gz
Bugzilla Bug 279723: PR_ReadDir needs to map the error code before
returning with a failure. The patch is contributed by Mathieu Poumeyrol <poumeyrol@idm.fr>. r=wtc. Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH
-rw-r--r--pr/src/pthreads/ptio.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/pr/src/pthreads/ptio.c b/pr/src/pthreads/ptio.c
index 3a876571..a4ffb6fe 100644
--- a/pr/src/pthreads/ptio.c
+++ b/pr/src/pthreads/ptio.c
@@ -4300,7 +4300,11 @@ PR_IMPLEMENT(PRDirEntry*) PR_ReadDir(PRDir *dir, PRDirFlags flags)
for (;;)
{
dp = readdir(dir->md.d);
- if (NULL == dp) return NULL;
+ if (NULL == dp)
+ {
+ pt_MapError(_PR_MD_MAP_READDIR_ERROR, errno);
+ return NULL;
+ }
if ((flags & PR_SKIP_DOT)
&& ('.' == dp->d_name[0])
&& (0 == dp->d_name[1])) continue;
@@ -4347,8 +4351,8 @@ PR_IMPLEMENT(PRStatus) PR_NewTCPSocketPair(PRFileDesc *fds[2])
if (pt_TestAbort()) return PR_FAILURE;
if (socketpair(AF_UNIX, SOCK_STREAM, 0, osfd) == -1) {
- pt_MapError(_PR_MD_MAP_SOCKETPAIR_ERROR, errno);
- return PR_FAILURE;
+ pt_MapError(_PR_MD_MAP_SOCKETPAIR_ERROR, errno);
+ return PR_FAILURE;
}
fds[0] = pt_SetMethods(osfd[0], PR_DESC_SOCKET_TCP, PR_FALSE, PR_FALSE);