ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/util/rcomb.c
(Generate patch)

Comparing ray/src/util/rcomb.c (file contents):
Revision 2.16 by greg, Thu May 23 15:48:44 2024 UTC vs.
Revision 2.17 by greg, Thu May 23 17:13:52 2024 UTC

# Line 543 | Line 543 | output_headinfo(FILE *fp)
543   static int
544   spawned_children(int np)
545   {
546 <        long    inpwidth = 0;
546 >        size_t  recsize = 0;
547          int     i, rv;
548  
549   #if defined(_WIN32) || defined(_WIN64)
# Line 559 | Line 559 | spawned_children(int np)
559                  mop[i].imx.nrows = 1;
560                  if (!rmx_prepare(&mop[i].imx))
561                          goto memerror;
562 <                inpwidth += rmx_array_size(&mop[i].imx);
562 >                recsize += rmx_array_size(&mop[i].imx);
563                  if (mop[i].rmp != &mop[i].imx) {
564                          mop[i].rmp->nrows = 1;
565                          if (!rmx_prepare(mop[i].rmp))
566                                  goto memerror;
567                        inpwidth += rmx_array_size(mop[i].rmp);
567                  }
568          }
569                                  /* prep output row buffer */
# Line 601 | Line 600 | spawned_children(int np)
600                  cproc[i].pid = -1;
601                  rv = open_process(&cproc[i], NULL);
602                  if (rv <= 0) break;
603 <                if (!i && 2*rv >= inpwidth) {
603 >                if (!i && 2*rv >= recsize) {
604                          fputs("Problem too small for multi-processing\n",
605                                          stderr);
606 +                        close_processes(cproc, 1);
607                          exit(1);
608                  }
609          }
610        if (rv > 0)
611                return(1);      /* parent return value */
610          if (rv < 0) {
611                  perror("fork");
612 +                close_processes(cproc, i);
613                  exit(1);
614          }
615 +        if (rv > 0)             /* parent return? */
616 +                return(1);
617          inchild = i;            /* our child index */
618          while (i-- > 0)         /* don't share siblings' pipes */
619                  close(cproc[i].w);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines