|
|
@@ -13,3 +13,23 @@ Index: configure
|
|
|
|
|
|
#########
|
|
|
# Figure out whether or not we have a "usleep()" function.
|
|
|
+Index: src/os_unix.c
|
|
|
+--- src/os_unix.c 2005/08/13 17:17:02 1.49
|
|
|
++++ src/os_unix.c 2005/08/21 21:45:02 1.50
|
|
|
+@@ -1278,13 +1278,13 @@
|
|
|
+ */
|
|
|
+ int *aNew;
|
|
|
+ struct openCnt *pOpen = id->pOpen;
|
|
|
+- pOpen->nPending++;
|
|
|
+- aNew = sqliteRealloc( pOpen->aPending, pOpen->nPending*sizeof(int) );
|
|
|
++ aNew = sqliteRealloc( pOpen->aPending, (pOpen->nPending+1)*sizeof(int) );
|
|
|
+ if( aNew==0 ){
|
|
|
+ /* If a malloc fails, just leak the file descriptor */
|
|
|
+ }else{
|
|
|
+ pOpen->aPending = aNew;
|
|
|
+- pOpen->aPending[pOpen->nPending-1] = id->h;
|
|
|
++ pOpen->aPending[pOpen->nPending] = id->h;
|
|
|
++ pOpen->nPending++;
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ /* There are no outstanding locks so we can close the file immediately */
|