We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fdda7de commit 86095bcCopy full SHA for 86095bc
library/psa_its_file.c
@@ -62,9 +62,12 @@
62
#define PSA_ITS_MAGIC_STRING "PSA\0ITS\0"
63
#define PSA_ITS_MAGIC_LENGTH 8
64
65
+/* As rename fails on Windows if the new filepath already exists,
66
+ * use MoveFileExA with the MOVEFILE_REPLACE_EXISTING flag instead.
67
+ * Returns 0 on success, nonzero on failure. */
68
#if defined(_WIN32)
69
#define rename_replace_existing( oldpath, newpath ) \
- (!MoveFileExA( oldpath, newpath, MOVEFILE_REPLACE_EXISTING ))
70
+ ( ! MoveFileExA( oldpath, newpath, MOVEFILE_REPLACE_EXISTING ) )
71
#else
72
#define rename_replace_existing( oldpath, newpath ) rename( oldpath, newpath )
73
#endif
0 commit comments