/[jscoverage]/trunk/util.c
ViewVC logotype

Diff of /trunk/util.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 311 by siliconforks, Mon Oct 13 17:51:29 2008 UTC revision 359 by siliconforks, Sun Oct 26 05:09:51 2008 UTC
# Line 375  Line 375 
375    
376    copy_stream(source, destination);    copy_stream(source, destination);
377    
378    #ifndef _WIN32
379      /* copy permissions */
380      struct stat buf;
381      if (fstat(fileno(source), &buf) == -1) {
382        fatal("cannot stat file: %s", source_file);
383      }
384      fchmod(fileno(destination), buf.st_mode);
385    #endif
386    
387    fclose(source);    fclose(source);
388    fclose(destination);    fclose(destination);
389  }  }
# Line 417  Line 426 
426        head = recursive_dir_list(root, entry_wrt_root, head);        head = recursive_dir_list(root, entry_wrt_root, head);
427        free(entry_wrt_root);        free(entry_wrt_root);
428      }      }
429        else if (S_ISLNK(buf.st_mode)) {
430          /* check what it points to */
431          xstat(entry, &buf);
432          if (S_ISREG(buf.st_mode)) {
433            struct DirListEntry * p = xmalloc(sizeof(struct DirListEntry));
434            p->name = entry_wrt_root;
435            p->next = head;
436            head = p;
437          }
438          else {
439            fatal("refusing to follow symbolic link: %s", entry);
440          }
441        }
442      else {      else {
443        fatal("unknown file type: %s", entry);        fatal("unknown file type: %s", entry);
444      }      }

Legend:
Removed from v.311  
changed lines
  Added in v.359

  ViewVC Help
Powered by ViewVC 1.1.24