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

Comparing ray/src/cv/pkgBSDF.c (file contents):
Revision 2.2 by greg, Thu Aug 25 04:32:29 2011 UTC vs.
Revision 2.5 by greg, Sun Apr 21 22:56:14 2013 UTC

# Line 53 | Line 53 | geomBSDF(const SDData *bsp)
53          char    command[SDnameLn+64];
54          int     fd;
55                                          /* write MGF to temp file */
56 <        fd = open(mktemp(strcpy(tmpfile,TEMPLATE)), O_WRONLY|O_CREAT|O_EXCL);
56 >        fd = open(mktemp(strcpy(tmpfile,TEMPLATE)), O_WRONLY|O_CREAT|O_EXCL, 0600);
57          if (fd < 0) {
58                  fprintf(stderr, "Cannot open temp file '%s'\n", tmpfile);
59                  return(0);
60          }
61 <        write(fd, bsp->mgf, strlen(bsp->mgf));
61 >        (void)write(fd, bsp->mgf, strlen(bsp->mgf));
62          close(fd);
63                                          /* set up command */
64          if (do_instance) {
# Line 100 | Line 100 | cvtBSDF(char *fname)
100                  return(0);
101          }
102          SDclearBSDF(&myBSDF, fname);
103 <        if (SDreportEnglish(SDloadFile(&myBSDF, pname), stderr))
103 >        if (SDreportError(SDloadFile(&myBSDF, pname), stderr))
104                  return(0);
105          retOK = (myBSDF.dim[0] > FTINY) & (myBSDF.dim[1] > FTINY);
106          if (!retOK) {
# Line 113 | Line 113 | cvtBSDF(char *fname)
113                          retOK = (freopen(rname, "w", stdout) != NULL);
114                  }
115                  if (retOK) {
116 +                        if (myBSDF.matn[0] && myBSDF.makr[0])
117 +                                printf("# Material '%s' by '%s'\n\n",
118 +                                                myBSDF.matn, myBSDF.makr);
119                          if (myBSDF.mgf == NULL) {
120                                  faceBSDF(&myBSDF, .0);
121                          } else {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines