Remove a -W option which breaks with older gcc versions.
[mono.git] / mono / io-layer / locking.c
index a3439d019ce745ea2c20a8112f9a802ceb0366fc..57b18ca662e936243e78c14908fb6cf87d26cc4a 100644 (file)
 #include <mono/io-layer/handles-private.h>
 #include <mono/io-layer/io-private.h>
 
-#define LOGDEBUG(...)
-//#define LOGDEBUG(...) g_message (__VA_ARGS__)
+#if 0
+// #define DEBUG(...) g_message(__VA_ARGS__)
+#else
+#define DEBUG(...)
+#endif
 
 gboolean
 _wapi_lock_file_region (int fd, off_t offset, off_t length)
@@ -40,7 +43,7 @@ _wapi_lock_file_region (int fd, off_t offset, off_t length)
                ret = fcntl (fd, F_SETLK, &lock_data);
        } while(ret == -1 && errno == EINTR);
        
-       LOGDEBUG ("%s: fcntl returns %d", __func__, ret);
+       DEBUG ("%s: fcntl returns %d", __func__, ret);
 
        if (ret == -1) {
                /*
@@ -85,7 +88,7 @@ _wapi_unlock_file_region (int fd, off_t offset, off_t length)
                ret = fcntl (fd, F_SETLK, &lock_data);
        } while(ret == -1 && errno == EINTR);
        
-       LOGDEBUG ("%s: fcntl returns %d", __func__, ret);
+       DEBUG ("%s: fcntl returns %d", __func__, ret);
        
        if (ret == -1) {
                /*
@@ -132,7 +135,7 @@ LockFile (gpointer handle, guint32 offset_low, guint32 offset_high,
        if (!(file_handle->fileaccess & GENERIC_READ) &&
            !(file_handle->fileaccess & GENERIC_WRITE) &&
            !(file_handle->fileaccess & GENERIC_ALL)) {
-               LOGDEBUG ("%s: handle %p doesn't have GENERIC_READ or GENERIC_WRITE access: %u", __func__, handle, file_handle->fileaccess);
+               DEBUG ("%s: handle %p doesn't have GENERIC_READ or GENERIC_WRITE access: %u", __func__, handle, file_handle->fileaccess);
                SetLastError (ERROR_ACCESS_DENIED);
                return(FALSE);
        }
@@ -141,15 +144,13 @@ LockFile (gpointer handle, guint32 offset_low, guint32 offset_high,
        offset = ((gint64)offset_high << 32) | offset_low;
        length = ((gint64)length_high << 32) | length_low;
 
-       LOGDEBUG ("%s: Locking handle %p, offset %lld, length %lld", __func__, handle, offset, length);
+       DEBUG ("%s: Locking handle %p, offset %lld, length %lld", __func__, handle, offset, length);
 #else
        offset = offset_low;
        length = length_low;
 
-#ifdef DEBUG
-       g_message ("%s: Locking handle %p, offset %ld, length %ld", __func__,
+       DEBUG ("%s: Locking handle %p, offset %ld, length %ld", __func__,
                   handle, offset, length);
-#endif
 #endif
 
        return(_wapi_lock_file_region (fd, offset, length));
@@ -177,7 +178,7 @@ UnlockFile (gpointer handle, guint32 offset_low,
        if (!(file_handle->fileaccess & GENERIC_READ) &&
            !(file_handle->fileaccess & GENERIC_WRITE) &&
            !(file_handle->fileaccess & GENERIC_ALL)) {
-               LOGDEBUG ("%s: handle %p doesn't have GENERIC_READ or GENERIC_WRITE access: %u", __func__, handle, file_handle->fileaccess);
+               DEBUG ("%s: handle %p doesn't have GENERIC_READ or GENERIC_WRITE access: %u", __func__, handle, file_handle->fileaccess);
                SetLastError (ERROR_ACCESS_DENIED);
                return(FALSE);
        }
@@ -186,12 +187,12 @@ UnlockFile (gpointer handle, guint32 offset_low,
        offset = ((gint64)offset_high << 32) | offset_low;
        length = ((gint64)length_high << 32) | length_low;
 
-       LOGDEBUG ("%s: Unlocking handle %p, offset %lld, length %lld", __func__, handle, offset, length);
+       DEBUG ("%s: Unlocking handle %p, offset %lld, length %lld", __func__, handle, offset, length);
 #else
        offset = offset_low;
        length = length_low;
 
-       LOGDEBUG ("%s: Unlocking handle %p, offset %ld, length %ld", __func__, handle, offset, length);
+       DEBUG ("%s: Unlocking handle %p, offset %ld, length %ld", __func__, handle, offset, length);
 #endif
 
        return(_wapi_unlock_file_region (fd, offset, length));