[compiler-rt] r184878 - Don't use 'errno.h' on Apple just yet. This breaks for some of our buildbots.

Bill Wendling isanbard at gmail.com
Tue Jun 25 14:08:41 PDT 2013


Author: void
Date: Tue Jun 25 16:08:40 2013
New Revision: 184878

URL: http://llvm.org/viewvc/llvm-project?rev=184878&view=rev
Log:
Don't use 'errno.h' on Apple just yet. This breaks for some of our buildbots.

Modified:
    compiler-rt/trunk/lib/profile/GCDAProfiling.c

Modified: compiler-rt/trunk/lib/profile/GCDAProfiling.c
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/profile/GCDAProfiling.c?rev=184878&r1=184877&r2=184878&view=diff
==============================================================================
--- compiler-rt/trunk/lib/profile/GCDAProfiling.c (original)
+++ compiler-rt/trunk/lib/profile/GCDAProfiling.c Tue Jun 25 16:08:40 2013
@@ -20,7 +20,10 @@
 |*
 \*===----------------------------------------------------------------------===*/
 
+#ifndef __APPLE__
 #include <errno.h>
+#endif
+
 #include <fcntl.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -209,9 +212,11 @@ static int map_file() {
   write_buffer = mmap(0, file_size, PROT_READ | PROT_WRITE,
                       MAP_FILE | MAP_SHARED, fd, 0);
   if (write_buffer == (void *)-1) {
+#ifndef __APPLE__
     int errnum = errno;
     fprintf(stderr, "profiling: %s: cannot map: %s\n", filename,
             strerror(errnum));
+#endif
     return -1;
   }
   return 0;
@@ -219,9 +224,11 @@ static int map_file() {
 
 static void unmap_file() {
   if (msync(write_buffer, file_size, MS_SYNC) == -1) {
+#ifndef __APPLE__
     int errnum = errno;
     fprintf(stderr, "profiling: %s: cannot msync: %s\n", filename,
             strerror(errnum));
+#endif
   }
 
   /* We explicitly ignore errors from unmapping because at this point the data
@@ -259,9 +266,11 @@ void llvm_gcda_start_file(const char *or
       fd = open(filename, O_RDWR | O_CREAT, 0644);
       if (fd == -1) {
         /* Bah! It's hopeless. */
+#ifndef __APPLE__
         int errnum = errno;
         fprintf(stderr, "profiling: %s: cannot open: %s\n", filename,
                 strerror(errnum));
+#endif
         free(filename);
         return;
       }





More information about the llvm-commits mailing list