diff options
author | stephan <stephan@noemail.net> | 2022-12-10 05:00:16 +0000 |
---|---|---|
committer | stephan <stephan@noemail.net> | 2022-12-10 05:00:16 +0000 |
commit | 9be7a363ccf8a9bb78dcf390bc1f7bfac1d123b4 (patch) | |
tree | a9741d41dda82abeb5d56f47f474e24af9f96a24 /src/os_unix.c | |
parent | 412237fba58ccf7a766895d6ae1b7348e760e73d (diff) | |
parent | 8ccef8f27f93b29e3d1a634f928169c8744bc07d (diff) | |
download | sqlite-9be7a363ccf8a9bb78dcf390bc1f7bfac1d123b4.tar.gz sqlite-9be7a363ccf8a9bb78dcf390bc1f7bfac1d123b4.zip |
Merge trunk into wasi-patches branch.
FossilOrigin-Name: 13dade955d46020ab408734123261e9fadb8bccbaf67003b111112af4789d8c0
Diffstat (limited to 'src/os_unix.c')
-rw-r--r-- | src/os_unix.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/os_unix.c b/src/os_unix.c index af22d3cf8..e5ce36ebf 100644 --- a/src/os_unix.c +++ b/src/os_unix.c @@ -730,6 +730,9 @@ static int robust_open(const char *z, int f, mode_t m){ break; } if( fd>=SQLITE_MINIMUM_FILE_DESCRIPTOR ) break; + if( (f & (O_EXCL|O_CREAT))==(O_EXCL|O_CREAT) ){ + (void)osUnlink(z); + } osClose(fd); sqlite3_log(SQLITE_WARNING, "attempt to open \"%s\" as file descriptor %d", z, fd); @@ -6720,7 +6723,7 @@ static int unixRandomness(sqlite3_vfs *NotUsed, int nBuf, char *zBuf){ ** than the argument. */ static int unixSleep(sqlite3_vfs *NotUsed, int microseconds){ -#if OS_VXWORKS +#if OS_VXWORKS || _POSIX_C_SOURCE >= 199309L struct timespec sp; sp.tv_sec = microseconds / 1000000; |