update NSPR to 4.24 and keep NSPR Bug 1586070 and win64 patch intact.

This commit is contained in:
Roy Tam 2020-01-03 13:34:04 +08:00
commit 0b9855b841
487 changed files with 42933 additions and 48679 deletions

View file

@ -13,8 +13,8 @@
** 27-Oct-1999 lth. Initial version
***********************************************************************/
#include <plgetopt.h>
#include <nspr.h>
#include <plgetopt.h>
#include <nspr.h>
#include <stdio.h>
#include <stdlib.h>
@ -55,23 +55,25 @@ int main(int argc, char **argv)
PLOptStatus os;
PLOptState *opt = PL_CreateOptState(argc, argv, "hd");
while (PL_OPT_EOL != (os = PL_GetNextOpt(opt)))
while (PL_OPT_EOL != (os = PL_GetNextOpt(opt)))
{
if (PL_OPT_BAD == os) continue;
if (PL_OPT_BAD == os) {
continue;
}
switch (opt->option)
{
case 'd': /* debug */
debug = 1;
msgLevel = PR_LOG_ERROR;
break;
case 'h': /* help message */
Help();
break;
default:
break;
case 'd': /* debug */
debug = 1;
msgLevel = PR_LOG_ERROR;
break;
case 'h': /* help message */
Help();
break;
default:
break;
}
}
PL_DestroyOptState(opt);
PL_DestroyOptState(opt);
}
lm = PR_NewLogModule("Test"); /* Initialize logging */
@ -81,21 +83,27 @@ int main(int argc, char **argv)
*/
fd = PR_Open( NEW_FILENAME, PR_CREATE_FILE | PR_EXCL | PR_WRONLY, 0666 );
if ( NULL == fd ) {
if (debug) fprintf( stderr, "Open exclusive. Expected success, got failure\n");
if (debug) {
fprintf( stderr, "Open exclusive. Expected success, got failure\n");
}
failed_already = 1;
goto Finished;
}
written = PR_Write( fd, outBuf, OUT_SIZE );
if ( OUT_SIZE != written ) {
if (debug) fprintf( stderr, "Write after open exclusive failed\n");
if (debug) {
fprintf( stderr, "Write after open exclusive failed\n");
}
failed_already = 1;
goto Finished;
}
rv = PR_Close(fd);
if ( PR_FAILURE == rv ) {
if (debug) fprintf( stderr, "Close after open exclusive failed\n");
if (debug) {
fprintf( stderr, "Close after open exclusive failed\n");
}
failed_already = 1;
goto Finished;
}
@ -105,19 +113,25 @@ int main(int argc, char **argv)
*/
fd = PR_Open( NEW_FILENAME, PR_CREATE_FILE | PR_EXCL | PR_WRONLY, 0666 );
if ( NULL != fd ) {
if (debug) fprintf( stderr, "Open exclusive. Expected failure, got success\n");
if (debug) {
fprintf( stderr, "Open exclusive. Expected failure, got success\n");
}
failed_already = 1;
PR_Close(fd);
}
rv = PR_Delete( NEW_FILENAME );
if ( PR_FAILURE == rv ) {
if (debug) fprintf( stderr, "PR_Delete() failed\n");
if (debug) {
fprintf( stderr, "PR_Delete() failed\n");
}
failed_already = 1;
}
Finished:
if (debug) printf("%s\n", (failed_already)? "FAIL" : "PASS");
if (debug) {
printf("%s\n", (failed_already)? "FAIL" : "PASS");
}
return( (failed_already == PR_TRUE )? 1 : 0 );
} /* main() */
/* end op_excl.c */