Skip to content

Commit

Permalink
fix(mkillum, rcontrib, rtrace, ranimove, rsensor): stall under macOS …
Browse files Browse the repository at this point in the history
…10.15

due to broken flockfile() implementation -- workaround is better, anyway
  • Loading branch information
Gregungory committed Jul 20, 2020
1 parent a0cb878 commit 88c264b
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 9 deletions.
6 changes: 4 additions & 2 deletions src/gen/mkillum.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef lint
static const char RCSid[] = "$Id: mkillum.c,v 2.42 2016/09/15 22:34:41 greg Exp $";
static const char RCSid[] = "$Id: mkillum.c,v 2.43 2020/07/20 15:54:29 greg Exp $";
#endif
/*
* Make illum sources for optimizing rendering process
Expand Down Expand Up @@ -177,7 +177,9 @@ quit(ec) /* make sure exit is called */
int ec;
{
if (ray_pnprocs > 0) /* close children if any */
ray_pclose(0);
ray_pclose(0);
else if (ray_pnprocs < 0)
_exit(ec); /* avoid flush() in child */
exit(ec);
}

Expand Down
4 changes: 3 additions & 1 deletion src/rt/rcontrib.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef lint
static const char RCSid[] = "$Id: rcontrib.c,v 2.35 2019/04/07 16:39:39 greg Exp $";
static const char RCSid[] = "$Id: rcontrib.c,v 2.36 2020/07/20 15:54:29 greg Exp $";
#endif
/*
* Accumulate ray contributions for a set of materials
Expand Down Expand Up @@ -179,6 +179,8 @@ quit( /* quit program */
{
if (nchild > 0) /* close children if any */
end_children(code != 0);
else if (nchild < 0)
_exit(code); /* avoid flush() in child */
exit(code);
}

Expand Down
6 changes: 4 additions & 2 deletions src/rt/rtrace.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef lint
static const char RCSid[] = "$Id: rtrace.c,v 2.98 2020/06/16 17:58:11 greg Exp $";
static const char RCSid[] = "$Id: rtrace.c,v 2.99 2020/07/20 15:54:29 greg Exp $";
#endif
/*
* rtrace.c - program and variables for individual ray tracing.
Expand Down Expand Up @@ -92,8 +92,10 @@ quit( /* quit program */
{
if (ray_pnprocs > 0) /* close children if any */
ray_pclose(0);
else if (ray_pnprocs < 0)
_exit(code); /* avoid flush() in child */
#ifndef NON_POSIX
else if (!ray_pnprocs) {
else {
headclean(); /* delete header file */
pfclean(); /* clean up persist files */
}
Expand Down
6 changes: 4 additions & 2 deletions src/util/ranimove.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef lint
static const char RCSid[] = "$Id: ranimove.c,v 3.18 2016/04/18 22:39:13 greg Exp $";
static const char RCSid[] = "$Id: ranimove.c,v 3.19 2020/07/20 15:54:29 greg Exp $";
#endif
/*
* Radiance object animation program
Expand Down Expand Up @@ -193,7 +193,9 @@ void
quit(int ec) /* make sure exit is called */
{
if (ray_pnprocs > 0) /* close children if any */
ray_pclose(0);
ray_pclose(0);
else if (ray_pnprocs < 0)
_exit(ec); /* avoid flush in child */
exit(ec);
}

Expand Down
6 changes: 4 additions & 2 deletions src/util/rsensor.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef lint
static const char RCSid[] = "$Id: rsensor.c,v 2.18 2015/06/09 21:34:15 greg Exp $";
static const char RCSid[] = "$Id: rsensor.c,v 2.19 2020/07/20 15:54:29 greg Exp $";
#endif

/*
Expand Down Expand Up @@ -77,7 +77,9 @@ quit(ec) /* make sure exit is called */
int ec;
{
if (ray_pnprocs > 0) /* close children if any */
ray_pclose(0);
ray_pclose(0);
else if (ray_pnprocs < 0)
_exit(ec); /* avoid flush in child */
exit(ec);
}

Expand Down

0 comments on commit 88c264b

Please # to comment.