summaryrefslogtreecommitdiffstats
path: root/nsprpub/pr/tests/parent.c
diff options
context:
space:
mode:
Diffstat (limited to 'nsprpub/pr/tests/parent.c')
-rw-r--r--nsprpub/pr/tests/parent.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/nsprpub/pr/tests/parent.c b/nsprpub/pr/tests/parent.c
index e49af2a98..f43ce0c3f 100644
--- a/nsprpub/pr/tests/parent.c
+++ b/nsprpub/pr/tests/parent.c
@@ -28,7 +28,7 @@ static char *default_argv[] = {"cvar", "-c", "2000", NULL};
static void PrintUsage(void)
{
PR_fprintf(PR_GetSpecialFD(PR_StandardError),
- "Usage: parent [-d] child [options]\n");
+ "Usage: parent [-d] child [options]\n");
}
int main(int argc, char **argv)
@@ -49,8 +49,9 @@ int main(int argc, char **argv)
argv += 1; /* don't care about our program name */
while (*argv != NULL && argv[0][0] == '-')
{
- if (argv[0][1] == 'd')
+ if (argv[0][1] == 'd') {
debug = PR_GetSpecialFD(PR_StandardError);
+ }
else
{
PrintUsage();
@@ -68,7 +69,9 @@ int main(int argc, char **argv)
}
child->name = *child->argv;
- if (NULL != debug) PR_fprintf(debug, "Forking %s\n", child->name);
+ if (NULL != debug) {
+ PR_fprintf(debug, "Forking %s\n", child->name);
+ }
child->attr = PR_NewProcessAttr();
PR_ProcessAttrSetStdioRedirect(
@@ -80,7 +83,7 @@ int main(int argc, char **argv)
t_start = PR_IntervalNow();
child->process = PR_CreateProcess(
- child->name, child->argv, NULL, child->attr);
+ child->name, child->argv, NULL, child->attr);
t_elapsed = (PRIntervalTime) (PR_IntervalNow() - t_start);
PR_DestroyProcessAttr(child->attr);
@@ -99,7 +102,9 @@ int main(int argc, char **argv)
if (0 == test_status)
{
- if (NULL != debug) PR_fprintf(debug, "Waiting for child to exit\n");
+ if (NULL != debug) {
+ PR_fprintf(debug, "Waiting for child to exit\n");
+ }
rv = PR_WaitProcess(child->process, &test_status);
if (PR_SUCCESS == rv)
{
@@ -111,14 +116,15 @@ int main(int argc, char **argv)
else
{
test_status = 1;
- if (NULL != debug)
+ if (NULL != debug) {
PR_fprintf(debug, "PR_WaitProcess failed\n");
+ }
}
}
PR_DELETE(child);
PR_Cleanup();
return test_status;
-
+
} /* main */
/* parent.c */