X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=apps%2Fapps.c;h=34cd552eb538e65d16b018d57e926d3acb565670;hb=25f350a058cea31ad772a0542f6f8f81094d074d;hp=8c9726ebd7b060fc6e28a4feed712a8e03e6cf94;hpb=121cb9ee38c83c34028d331b7d32015f22a0dd08;p=oweals%2Fopenssl.git diff --git a/apps/apps.c b/apps/apps.c index 8c9726ebd7..34cd552eb5 100644 --- a/apps/apps.c +++ b/apps/apps.c @@ -333,16 +333,13 @@ void program_name(char *in, char *out, int size) #ifdef OPENSSL_SYS_WIN32 int WIN32_rename(char *from, char *to) { -#ifdef OPENSSL_SYS_WINNT - int ret; -/* Note: MoveFileEx() doesn't work under Win95, Win98 */ - - ret=MoveFileEx(from,to,MOVEFILE_REPLACE_EXISTING|MOVEFILE_COPY_ALLOWED); - return(ret?0:-1); -#else - unlink(to); - return MoveFile(from, to); -#endif + /* Windows rename gives and error if 'to' exists, so delete it + * first and ignore file not found errror + */ + if((remove(to) != 0) && (errno != ENOENT)) + return -1; +#undef rename + return rename(from, to); } #endif