Check return value of MoveFileEx correctly.
authorMarcus Brinkmann <marcus.brinkmann@ruhr-uni-bochum.de>
Mon, 15 Mar 2010 14:52:49 +0000 (15:52 +0100)
committerRalf Habacker <ralf.habacker@freenet.de>
Tue, 16 Mar 2010 22:09:48 +0000 (23:09 +0100)
dbus/dbus-file-win.c

index ca346e3..499237e 100644 (file)
@@ -249,7 +249,7 @@ _dbus_string_save_to_file (const DBusString *str,
   fd = -1;
 
   /* Unlike rename(), MoveFileEx() can replace existing files */
-  if (MoveFileExA (tmp_filename_c, filename_c, MOVEFILE_REPLACE_EXISTING) < 0)
+  if (!MoveFileExA (tmp_filename_c, filename_c, MOVEFILE_REPLACE_EXISTING))
     {
       char *emsg = _dbus_win_error_string (GetLastError ());
       dbus_set_error (error, DBUS_ERROR_FAILED,