Fix the Win32_rename() function so it correctly
returns an error code. Use the same code in Win9X and NT. Fix some ca.c options so they work under Win32: unlink/rename wont work under Win32 unless the file is closed.
This commit is contained in:
parent
121cb9ee38
commit
25f350a058
17
apps/apps.c
17
apps/apps.c
@ -333,16 +333,13 @@ void program_name(char *in, char *out, int size)
|
|||||||
#ifdef OPENSSL_SYS_WIN32
|
#ifdef OPENSSL_SYS_WIN32
|
||||||
int WIN32_rename(char *from, char *to)
|
int WIN32_rename(char *from, char *to)
|
||||||
{
|
{
|
||||||
#ifdef OPENSSL_SYS_WINNT
|
/* Windows rename gives and error if 'to' exists, so delete it
|
||||||
int ret;
|
* first and ignore file not found errror
|
||||||
/* Note: MoveFileEx() doesn't work under Win95, Win98 */
|
*/
|
||||||
|
if((remove(to) != 0) && (errno != ENOENT))
|
||||||
ret=MoveFileEx(from,to,MOVEFILE_REPLACE_EXISTING|MOVEFILE_COPY_ALLOWED);
|
return -1;
|
||||||
return(ret?0:-1);
|
#undef rename
|
||||||
#else
|
return rename(from, to);
|
||||||
unlink(to);
|
|
||||||
return MoveFile(from, to);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -1569,6 +1569,10 @@ bad:
|
|||||||
}
|
}
|
||||||
j=TXT_DB_write(out,db);
|
j=TXT_DB_write(out,db);
|
||||||
if (j <= 0) goto err;
|
if (j <= 0) goto err;
|
||||||
|
BIO_free_all(out);
|
||||||
|
out = NULL;
|
||||||
|
BIO_free_all(in);
|
||||||
|
in = NULL;
|
||||||
strncpy(buf[1],dbfile,BSIZE-4);
|
strncpy(buf[1],dbfile,BSIZE-4);
|
||||||
buf[1][BSIZE-4]='\0';
|
buf[1][BSIZE-4]='\0';
|
||||||
#ifndef OPENSSL_SYS_VMS
|
#ifndef OPENSSL_SYS_VMS
|
||||||
|
Loading…
x
Reference in New Issue
Block a user