X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dbus%2Fdbus-internals.c;h=fcea07900743548808eb4e717cb6d4daeb241541;hb=775f77c719de325a0cbf8fb1d56ebbb8f6a923d7;hp=4cafb262a8826914fd366dffbc01207b3783e467;hpb=7a4cd46284dd634c165b5c4eb23606b7c0ff4ade;p=platform%2Fupstream%2Fdbus.git diff --git a/dbus/dbus-internals.c b/dbus/dbus-internals.c index 4cafb26..fcea079 100644 --- a/dbus/dbus-internals.c +++ b/dbus/dbus-internals.c @@ -20,6 +20,8 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * */ + +#include #include "dbus-internals.h" #include "dbus-protocol.h" #include "dbus-marshal-basic.h" @@ -30,6 +32,7 @@ #include #ifdef DBUS_USE_OUTPUT_DEBUG_STRING #include +#include #endif /** @@ -298,9 +301,6 @@ static dbus_bool_t verbose = TRUE; #include #endif -#ifdef _MSC_VER -#define inline -#endif #ifdef DBUS_USE_OUTPUT_DEBUG_STRING static char module_name[1024]; #endif @@ -347,7 +347,6 @@ _dbus_verbose_init (void) static char *_dbus_file_path_extract_elements_from_tail(const char *file,int level) { static int prefix = -1; - char *p; if (prefix == -1) { @@ -436,11 +435,11 @@ _dbus_verbose_real (const char *format, char buf[1024]; strcpy(buf,module_name); #ifdef DBUS_CPP_SUPPORTS_VARIABLE_MACRO_ARGUMENTS - vsprintf (buf+strlen(buf), "[%s(%d):%s] ",_dbus_file_path_extract_elements_from_tail(file,2),line,function); + sprintf (buf+strlen(buf), "[%s(%d):%s] ",_dbus_file_path_extract_elements_from_tail(file,2),line,function); #endif vsprintf (buf+strlen(buf),format, args); va_end (args); - OutputDebugString(buf); + OutputDebugStringA(buf); } #else #ifdef DBUS_CPP_SUPPORTS_VARIABLE_MACRO_ARGUMENTS @@ -716,27 +715,13 @@ _dbus_create_uuid_file_exclusively (const DBusString *filename, goto error; } - /* FIXME this is racy; we need a save_file_exclusively - * function. But in practice this should be fine for now. - * - * - first be sure we can create the file and it - * doesn't exist by creating it empty with O_EXCL - * - then create it by creating a temporary file and - * overwriting atomically with rename() - */ - if (!_dbus_create_file_exclusively (filename, error)) - goto error; - if (!_dbus_string_append_byte (&encoded, '\n')) { _DBUS_SET_OOM (error); goto error; } - if (!_dbus_string_save_to_file (&encoded, filename, error)) - goto error; - - if (!_dbus_make_file_world_readable (filename, error)) + if (!_dbus_string_save_to_file (&encoded, filename, TRUE, error)) goto error; _dbus_string_free (&encoded);