Fix for bug 353899 . PR_CallOnce and PR_CallOnceWithArg do not set NSPR error code if once->initialized is TRUE and once->status is PR_FAILURE . r=wtc

This commit is contained in:
julien.pierre.bugs%sun.com 2007-05-10 01:21:41 +00:00
Родитель fa22fbd4f2
Коммит c01ca3026c
5 изменённых файлов: 16 добавлений и 2 удалений

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

@ -269,8 +269,11 @@
/* The library is not loaded */
#define PR_LIBRARY_NOT_LOADED_ERROR (-5926L)
/* The one-time function was previously called and failed. Its error code is no longer available */
#define PR_CALL_ONCE_ERROR (-5925L)
/* Placeholder for the end of the list */
#define PR_MAX_ERROR (-5925L)
#define PR_MAX_ERROR (-5924L)
extern void nspr_InitializePRErrorTable(void);
#define ERROR_TABLE_BASE_nspr (-6000L)

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

@ -117,11 +117,12 @@ static const struct PRErrorMessage text[] = {
{"PR_CONNECT_ABORTED_ERROR", "Connection aborted"},
{"PR_HOST_UNREACHABLE_ERROR", "Host is unreachable"},
{"PR_LIBRARY_NOT_LOADED_ERROR", "The library is not loaded"},
{"PR_CALL_ONCE_ERROR", "The one-time function was previously called and failed. Its error code is no longer available"},
{"PR_MAX_ERROR", "Placeholder for the end of the list"},
{0, 0}
};
static const struct PRErrorTable et = { text, "prerr", -6000L, 76 };
static const struct PRErrorTable et = { text, "prerr", -6000L, 77 };
void nspr_InitializePRErrorTable(void) {
PR_ErrorInstallTable(&et);

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

@ -133,6 +133,7 @@ ec PR_SOCKET_SHUTDOWN_ERROR, "Socket shutdown"
ec PR_CONNECT_ABORTED_ERROR, "Connection aborted"
ec PR_HOST_UNREACHABLE_ERROR, "Host is unreachable"
ec PR_LIBRARY_NOT_LOADED_ERROR, "The library is not loaded"
ec PR_CALL_ONCE_ERROR, "The one-time function was previously called and failed. Its error code is no longer available"
ec PR_MAX_ERROR, "Placeholder for the end of the list"

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

@ -113,4 +113,5 @@ PR_SOCKET_SHUTDOWN_ERROR=Socket shutdown
PR_CONNECT_ABORTED_ERROR=Connection aborted
PR_HOST_UNREACHABLE_ERROR=Host is unreachable
PR_LIBRARY_NOT_LOADED_ERROR=The library is not loaded
PR_CALL_ONCE_ERROR=The one-time function was previously called and failed. Its error code is no longer available
PR_MAX_ERROR=Placeholder for the end of the list

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

@ -824,6 +824,10 @@ PR_IMPLEMENT(PRStatus) PR_CallOnce(
}
PR_Unlock(mod_init.ml);
}
} else {
if (PR_SUCCESS != once->status) {
PR_SetError(PR_CALL_ONCE_ERROR, 0);
}
}
return once->status;
}
@ -849,6 +853,10 @@ PR_IMPLEMENT(PRStatus) PR_CallOnceWithArg(
}
PR_Unlock(mod_init.ml);
}
} else {
if (PR_SUCCESS != once->status) {
PR_SetError(PR_CALL_ONCE_ERROR, 0);
}
}
return once->status;
}