diff options
author | cvs2hg <devnull@localhost> | 2004-04-16 22:28:04 +0000 |
---|---|---|
committer | cvs2hg <devnull@localhost> | 2004-04-16 22:28:04 +0000 |
commit | f4c156a0df550fc3ccb6395b97ff98b612723b3b (patch) | |
tree | 513ada980b1cc6324ec31920d6b5da061e049c92 /pr/tests/sigpipe.c | |
parent | 57c2cc83bfe90fe3b51c3c8ba1e0cd8a7dc9636a (diff) | |
download | nspr-hg-f4c156a0df550fc3ccb6395b97ff98b612723b3b.tar.gz |
fixup commit for branch 'AVIARY_1_0_20040515_BRANCH'THUNDERBIRD_0_6_RELEASETHUNDERBIRD_0_6_BASENETSCAPE_7_2_RELEASEMOZILLA_1_7_RELEASEMOZILLA_1_7_RC3MOZILLA_1_7_RC2MOZILLA_1_7_RC1MOZILLA_1_7_3_RELEASEMOZILLA_1_7_2_RELEASEMOZILLA_1_7_2_BASEMOZILLA_1_7_1_RELEASECAMINO_0_8_RELEASECAMINO_0_8_BETACAMINO_0_8_1_RELEASEAVIARY_20040809_MERGEPOINTAVIARY_1_0_20040515_BASE
Diffstat (limited to 'pr/tests/sigpipe.c')
-rw-r--r-- | pr/tests/sigpipe.c | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/pr/tests/sigpipe.c b/pr/tests/sigpipe.c index 2c708e29..28e7e251 100644 --- a/pr/tests/sigpipe.c +++ b/pr/tests/sigpipe.c @@ -69,7 +69,7 @@ int main(void) #endif #include <errno.h> -int main(void) +static void Test(void *arg) { #ifdef XP_OS2 HFILE pipefd[2]; @@ -79,9 +79,6 @@ int main(void) int rv; char c = '\0'; - /* This initializes NSPR. */ - PR_SetError(0, 0); - #ifdef XP_OS2 if (DosCreatePipe(&pipefd[0], &pipefd[1], 4096) != 0) { #else @@ -103,6 +100,27 @@ int main(void) } close(pipefd[1]); printf("write to broken pipe failed with EPIPE, as expected\n"); +} + +int main(void) +{ + PRThread *thread; + + /* This initializes NSPR. */ + PR_SetError(0, 0); + + thread = PR_CreateThread(PR_USER_THREAD, Test, NULL, PR_PRIORITY_NORMAL, + PR_GLOBAL_THREAD, PR_JOINABLE_THREAD, 0); + if (thread == NULL) { + fprintf(stderr, "PR_CreateThread failed\n"); + exit(1); + } + if (PR_JoinThread(thread) == PR_FAILURE) { + fprintf(stderr, "PR_JoinThread failed\n"); + exit(1); + } + Test(NULL); + printf("PASSED\n"); return 0; } |