Modified: trunk/base/src/darwintracelib1.0/darwintrace.c (80068 => 80069)
--- trunk/base/src/darwintracelib1.0/darwintrace.c 2011-07-03 20:29:06 UTC (rev 80068)
+++ trunk/base/src/darwintracelib1.0/darwintrace.c 2011-07-03 22:06:21 UTC (rev 80069)
@@ -163,15 +163,15 @@
#if __STDC_VERSION__>=199901L
#if DARWINTRACE_DEBUG_OUTPUT
-#define dprintf(...) fprintf(stderr, __VA_ARGS__)
+#define debug_printf(...) fprintf(stderr, __VA_ARGS__)
#else
-#define dprintf(...)
+#define debug_printf(...)
#endif
#else
#if DARWINTRACE_DEBUG_OUTPUT
__attribute__ ((format (printf, 1, 2)))
static inline
-int dprintf(const char *format, ...) {
+int debug_printf(const char *format, ...) {
int ret;
va_list args;
va_start(args, format);
@@ -180,7 +180,7 @@
return ret;
}
#else
-#define dprintf(format, param)
+#define debug_printf(format, param)
#endif
#endif
@@ -362,11 +362,11 @@
strncpy(sun.sun_path, __env_darwintrace_log, sizeof(sun.sun_path));
if(connect(sock, (struct sockaddr*)&sun, strlen(__env_darwintrace_log)+1+sizeof(sun.sun_family))!=-1)
{
- dprintf("darwintrace: connect successful. socket %d\n", sock);
+ debug_printf("darwintrace: connect successful. socket %d\n", sock);
__darwintrace_fd=sock;
ask_for_filemap();
} else {
- dprintf("connect failed: %s\n", strerror(errno));
+ debug_printf("connect failed: %s\n", strerror(errno));
abort();
}
errno = olderrno;
@@ -469,7 +469,7 @@
}
}
- dprintf("darwintrace: cleanup resulted in %s\n", path);
+ debug_printf("darwintrace: cleanup resulted in %s\n", path);
}
/*
@@ -663,7 +663,7 @@
__darwintrace_setup();
isInSandbox = __darwintrace_is_in_sandbox(path, newpath);
if (isInSandbox == 0) {
- dprintf("darwintrace: creation/writing was forbidden at %s\n", path);
+ debug_printf("darwintrace: creation/writing was forbidden at %s\n", path);
errno = EACCES;
result = -1;
}
@@ -809,10 +809,10 @@
int result = 0;
int isInSandbox = __darwintrace_is_in_sandbox(path, 0);
if (isInSandbox == 1) {
- dprintf("darwintrace: unlink was allowed at %s\n", path);
+ debug_printf("darwintrace: unlink was allowed at %s\n", path);
} else if (isInSandbox == 0) {
/* outside sandbox, but sandbox is defined: forbid */
- dprintf("darwintrace: unlink was forbidden at %s\n", path);
+ debug_printf("darwintrace: unlink was forbidden at %s\n", path);
errno = EACCES;
result = -1;
}
@@ -831,7 +831,7 @@
int result = 0;
int isInSandbox = __darwintrace_is_in_sandbox(path, 0);
if (isInSandbox == 1) {
- dprintf("darwintrace: mkdir was allowed at %s\n", path);
+ debug_printf("darwintrace: mkdir was allowed at %s\n", path);
} else if (isInSandbox == 0) {
/* outside sandbox, but sandbox is defined: forbid */
/* only consider directories that do not exist. */
@@ -840,7 +840,7 @@
err = lstat(path, &theInfo);
if ((err == -1) && (errno == ENOENT))
{
- dprintf("darwintrace: mkdir was forbidden at %s\n", path);
+ debug_printf("darwintrace: mkdir was forbidden at %s\n", path);
errno = EACCES;
result = -1;
} /* otherwise, mkdir will do nothing (directory exists) or fail
@@ -861,10 +861,10 @@
int result = 0;
int isInSandbox = __darwintrace_is_in_sandbox(path, 0);
if (isInSandbox == 1) {
- dprintf("darwintrace: rmdir was allowed at %s\n", path);
+ debug_printf("darwintrace: rmdir was allowed at %s\n", path);
} else if (isInSandbox == 0) {
/* outside sandbox, but sandbox is defined: forbid */
- dprintf("darwintrace: removing directory %s was forbidden\n", path);
+ debug_printf("darwintrace: removing directory %s was forbidden\n", path);
errno = EACCES;
result = -1;
}
@@ -883,10 +883,10 @@
int result = 0;
int isInSandbox = __darwintrace_is_in_sandbox(from, 0);
if (isInSandbox == 1) {
- dprintf("darwintrace: rename was allowed at %s\n", from);
+ debug_printf("darwintrace: rename was allowed at %s\n", from);
} else if (isInSandbox == 0) {
/* outside sandbox, but sandbox is defined: forbid */
- dprintf("darwintrace: renaming from %s was forbidden\n", from);
+ debug_printf("darwintrace: renaming from %s was forbidden\n", from);
errno = EACCES;
result = -1;
}
@@ -894,10 +894,10 @@
if (result == 0) {
isInSandbox = __darwintrace_is_in_sandbox(to, 0);
if (isInSandbox == 1) {
- dprintf("darwintrace: rename was allowed at %s\n", to);
+ debug_printf("darwintrace: rename was allowed at %s\n", to);
} else if (isInSandbox == 0) {
/* outside sandbox, but sandbox is defined: forbid */
- dprintf("darwintrace: renaming to %s was forbidden\n", to);
+ debug_printf("darwintrace: renaming to %s was forbidden\n", to);
errno = EACCES;
result = -1;
}