Fossil SCM
Fix the code for obtaining process ids on windows.
Commit
4695f217ce5e1bd7df1b5947331bc12fbb25dc8226062131f670211d96c3d24d
Parent
86b43a464856869…
1 file changed
+5
-5
+5
-5
| --- src/backoffice.c | ||
| +++ src/backoffice.c | ||
| @@ -39,11 +39,13 @@ | ||
| 39 | 39 | ** will restart using the new binary automatically. |
| 40 | 40 | */ |
| 41 | 41 | #include "config.h" |
| 42 | 42 | #include "backoffice.h" |
| 43 | 43 | #include <time.h> |
| 44 | -#if !defined(_WIN32) | |
| 44 | +#if defined(_WIN32) | |
| 45 | +# include <windows.h> | |
| 46 | +#else | |
| 45 | 47 | # include <sys/types.h> |
| 46 | 48 | # include <signal.h> |
| 47 | 49 | #endif |
| 48 | 50 | |
| 49 | 51 | /* |
| @@ -141,15 +143,13 @@ | ||
| 141 | 143 | /* |
| 142 | 144 | ** Return a process id number for the current process |
| 143 | 145 | */ |
| 144 | 146 | static sqlite3_uint64 backofficeProcessId(void){ |
| 145 | 147 | #if defined(_WIN32) |
| 146 | - ULONG Id = 0; | |
| 147 | - GetCurrentProcessId(&Id); | |
| 148 | - return Id; | |
| 148 | + return (sqlite3_uint64)GetCurrentProcessId(); | |
| 149 | 149 | #else |
| 150 | - return getpid(); | |
| 150 | + return (sqlite3_uint64)getpid(); | |
| 151 | 151 | #endif |
| 152 | 152 | } |
| 153 | 153 | |
| 154 | 154 | /* |
| 155 | 155 | ** COMMAND: test-process-id |
| 156 | 156 |
| --- src/backoffice.c | |
| +++ src/backoffice.c | |
| @@ -39,11 +39,13 @@ | |
| 39 | ** will restart using the new binary automatically. |
| 40 | */ |
| 41 | #include "config.h" |
| 42 | #include "backoffice.h" |
| 43 | #include <time.h> |
| 44 | #if !defined(_WIN32) |
| 45 | # include <sys/types.h> |
| 46 | # include <signal.h> |
| 47 | #endif |
| 48 | |
| 49 | /* |
| @@ -141,15 +143,13 @@ | |
| 141 | /* |
| 142 | ** Return a process id number for the current process |
| 143 | */ |
| 144 | static sqlite3_uint64 backofficeProcessId(void){ |
| 145 | #if defined(_WIN32) |
| 146 | ULONG Id = 0; |
| 147 | GetCurrentProcessId(&Id); |
| 148 | return Id; |
| 149 | #else |
| 150 | return getpid(); |
| 151 | #endif |
| 152 | } |
| 153 | |
| 154 | /* |
| 155 | ** COMMAND: test-process-id |
| 156 |
| --- src/backoffice.c | |
| +++ src/backoffice.c | |
| @@ -39,11 +39,13 @@ | |
| 39 | ** will restart using the new binary automatically. |
| 40 | */ |
| 41 | #include "config.h" |
| 42 | #include "backoffice.h" |
| 43 | #include <time.h> |
| 44 | #if defined(_WIN32) |
| 45 | # include <windows.h> |
| 46 | #else |
| 47 | # include <sys/types.h> |
| 48 | # include <signal.h> |
| 49 | #endif |
| 50 | |
| 51 | /* |
| @@ -141,15 +143,13 @@ | |
| 143 | /* |
| 144 | ** Return a process id number for the current process |
| 145 | */ |
| 146 | static sqlite3_uint64 backofficeProcessId(void){ |
| 147 | #if defined(_WIN32) |
| 148 | return (sqlite3_uint64)GetCurrentProcessId(); |
| 149 | #else |
| 150 | return (sqlite3_uint64)getpid(); |
| 151 | #endif |
| 152 | } |
| 153 | |
| 154 | /* |
| 155 | ** COMMAND: test-process-id |
| 156 |