X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mono%2Fio-layer%2Fposix.c;h=2856d4fcd615cf7dbb973f27830bc391c66255df;hb=b8893efbccd64f92c81082e42b8e480b74881927;hp=b51c1adf11e647046c035ae92671a008a40925ed;hpb=0aedc3f6fb2194817c766659c50a7e7f4786672e;p=mono.git diff --git a/mono/io-layer/posix.c b/mono/io-layer/posix.c index b51c1adf11e..2856d4fcd61 100644 --- a/mono/io-layer/posix.c +++ b/mono/io-layer/posix.c @@ -7,6 +7,7 @@ * (C) 2002 Ximian, Inc. * Copyright (c) 2002-2009 Novell, Inc. * Copyright 2011 Xamarin Inc + * Licensed under the MIT license. See LICENSE file in the project root for full license information. */ #include @@ -23,12 +24,8 @@ #include #include #include - -#if 0 -#define DEBUG(...) g_message(__VA_ARGS__) -#else -#define DEBUG(...) -#endif +#include +#include static guint32 convert_from_flags(int flags) @@ -46,7 +43,7 @@ convert_from_flags(int flags) } else if ((flags & O_ACCMODE) == O_RDWR) { fileaccess=GENERIC_READ|GENERIC_WRITE; } else { - DEBUG("%s: Can't figure out flags 0x%x", __func__, flags); + MONO_TRACE (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: Can't figure out flags 0x%x", __func__, flags); } /* Maybe sort out create mode too */ @@ -61,7 +58,7 @@ gpointer _wapi_stdhandle_create (int fd, const gchar *name) gpointer handle; int flags; - DEBUG("%s: creating standard handle type %s, fd %d", __func__, + MONO_TRACE (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: creating standard handle type %s, fd %d", __func__, name, fd); #if !defined(__native_client__) @@ -74,7 +71,7 @@ gpointer _wapi_stdhandle_create (int fd, const gchar *name) /* Invalid fd. Not really much point checking for EBADF * specifically */ - DEBUG("%s: fcntl error on fd %d: %s", __func__, fd, + MONO_TRACE (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: fcntl error on fd %d: %s", __func__, fd, strerror(errno)); SetLastError (_wapi_get_win32_file_error (errno)); @@ -111,7 +108,7 @@ gpointer _wapi_stdhandle_create (int fd, const gchar *name) return(INVALID_HANDLE_VALUE); } - DEBUG("%s: returning handle %p", __func__, handle); + MONO_TRACE (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: returning handle %p", __func__, handle); return(handle); }