[108032] trunk/base/src/darwintracelib1.0/darwintrace.c

cal at macports.org cal at macports.org
Wed Jul 10 17:00:31 PDT 2013


Revision: 108032
          https://trac.macports.org/changeset/108032
Author:   cal at macports.org
Date:     2013-07-10 17:00:31 -0700 (Wed, 10 Jul 2013)
Log Message:
-----------
darwintrace: use uint32_t as size field in the communication protocol between darwintrace and tracelib

Modified Paths:
--------------
    trunk/base/src/darwintracelib1.0/darwintrace.c

Modified: trunk/base/src/darwintracelib1.0/darwintrace.c
===================================================================
--- trunk/base/src/darwintracelib1.0/darwintrace.c	2013-07-10 23:57:01 UTC (rev 108031)
+++ trunk/base/src/darwintracelib1.0/darwintrace.c	2013-07-11 00:00:31 UTC (rev 108032)
@@ -42,6 +42,9 @@
 #if HAVE_SYS_CDEFS_H
 #include <sys/cdefs.h>
 #endif
+
+#include <stdint.h>
+
 #if defined(_DARWIN_FEATURE_64_BIT_INODE) && !defined(_DARWIN_FEATURE_ONLY_64_BIT_INODE)
 /* The architecture we're building for has multiple versions of stat.
    We need to undo sys/cdefs.h changes for _DARWIN_FEATURE_64_BIT_INODE */
@@ -118,7 +121,7 @@
 static inline char *const *__darwintrace_restore_env(char *const envp[]);
 static inline void __darwintrace_setup();
 static inline void __darwintrace_cleanup_path(char *path);
-static char *__send(const char *buf, size_t len, int answer);
+static char *__send(const char *buf, uint32_t len, int answer);
 
 /**
  * PID of the process darwintrace was last used in. This is used to detect
@@ -511,7 +514,7 @@
 		free(newfilemap);
 		if (filemap != NULL)
 			break;
-		newfilemap = __send("filemap\t", strlen("filemap\t"), 1);
+		newfilemap = __send("filemap\t", (uint32_t) strlen("filemap\t"), 1);
 	} while (!__sync_bool_compare_and_swap(&filemap, NULL, newfilemap));
 
 #if DARWINTRACE_DEBUG && 0
@@ -621,7 +624,7 @@
  * \param[in] fd a FD to the file, or 0, if none available
  */
 static inline void __darwintrace_log_op(const char *op, const char *path, int fd) {
-	int size;
+	uint32_t size;
 	char somepath[MAXPATHLEN];
 	char logbuffer[BUFFER_SIZE];
 
@@ -715,7 +718,7 @@
 static int dependency_check(char *path) {
 #define stat(y, z) syscall(SYS_stat, (y), (z))
 	char buffer[BUFFER_SIZE], *p;
-	size_t len;
+	uint32_t len;
 	int result = 0;
 	struct stat st;
 
@@ -810,7 +813,7 @@
  * \return allocated answer buffer. Callers should free this buffer. If an
  *         answer was not requested, \c NULL.
  */
-static char *__send(const char *buf, size_t len, int answer) {
+static char *__send(const char *buf, uint32_t len, int answer) {
 	fsend(&len, sizeof(len));
 	fsend(buf, len);
 
@@ -818,7 +821,7 @@
 		return NULL;
 	}
 
-	size_t recv_len = 0;
+	uint32_t recv_len = 0;
 	char *recv_buf;
 
 	frecv(&recv_len, sizeof(recv_len));
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20130710/e25f3304/attachment.html>


More information about the macports-changes mailing list