[darwinbuild-changes] [928] branches/PR-8817822/darwintrace/darwintrace.c

source_changes at macosforge.org source_changes at macosforge.org
Tue Feb 8 11:58:26 PST 2011


Revision: 928
          http://trac.macosforge.org/projects/darwinbuild/changeset/928
Author:   wsiegrist at apple.com
Date:     2011-02-08 11:58:24 -0800 (Tue, 08 Feb 2011)
Log Message:
-----------
Return sooner from redirection is redirect is not set

Modified Paths:
--------------
    branches/PR-8817822/darwintrace/darwintrace.c

Modified: branches/PR-8817822/darwintrace/darwintrace.c
===================================================================
--- branches/PR-8817822/darwintrace/darwintrace.c	2011-02-08 19:38:26 UTC (rev 927)
+++ branches/PR-8817822/darwintrace/darwintrace.c	2011-02-08 19:58:24 UTC (rev 928)
@@ -101,17 +101,19 @@
 }
 
 /* apply redirection heuristic to path */
-static inline char* darwintrace_redirect_path(const char* path) {	
+static inline char* darwintrace_redirect_path(const char* path) {
+  if (!darwintrace_redirect) return (char*)path;
+
   char *redirpath;
   redirpath = (char *)path;
-  if (darwintrace_redirect
-      && path[0] == '/'
+  if (path[0] == '/'
       && !darwintrace_except(path)
       && strncmp(darwintrace_buildroot, path, strlen(darwintrace_buildroot))!=0
       && strncmp(darwintrace_redirect, path, strlen(darwintrace_redirect))!=0 ) {
     asprintf(&redirpath, "%s%s%s", darwintrace_redirect, (*path == '/' ? "" : "/"), path);
     dprintf("darwintrace: redirect %s -> %s\n", path, redirpath);
   }
+
   return redirpath;
 }
 
@@ -228,7 +230,7 @@
 	mode = va_arg(args, int);
 	va_end(args);
 	result = open(redirpath, flags, mode);
-	if (result >= 0 && (flags & (O_CREAT | O_WRONLY /*O_RDWR*/)) == 0 ) {
+	if (result >= 0 && (flags & (O_CREAT | O_WRONLY)) == 0 ) {
 	  darwintrace_setup();
 	  if (darwintrace_fd >= 0) {
 	    char realpath[MAXPATHLEN];
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/darwinbuild-changes/attachments/20110208/54dbe7e5/attachment.html>


More information about the darwinbuild-changes mailing list