summaryrefslogtreecommitdiffstats
path: root/nsprpub/pr/tests/parent.c
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@wolfbeast.com>2020-01-02 21:01:38 +0100
committerwolfbeast <mcwerewolf@wolfbeast.com>2020-01-02 21:01:38 +0100
commitf7d30133221896638f7bf4f66c504255c4b14f48 (patch)
tree5f3e07a049f388a3a309a615b8884318f6668a98 /nsprpub/pr/tests/parent.c
parent26b297510a11758727438df4669357a2a2bc42ce (diff)
downloadUXP-f7d30133221896638f7bf4f66c504255c4b14f48.tar
UXP-f7d30133221896638f7bf4f66c504255c4b14f48.tar.gz
UXP-f7d30133221896638f7bf4f66c504255c4b14f48.tar.lz
UXP-f7d30133221896638f7bf4f66c504255c4b14f48.tar.xz
UXP-f7d30133221896638f7bf4f66c504255c4b14f48.zip
Issue #1338 - Part 1: Update NSPR to 4.24
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 */