Fossil SCM
More enhancements to backoffice diagnostics.
Commit
864a6f3922ed20829a196189c12edd8f2ed1a957273035e502dc8ba5ca1fbc2d
Parent
c6522a0fe01c11c…
1 file changed
+10
-2
+10
-2
| --- src/backoffice.c | ||
| +++ src/backoffice.c | ||
| @@ -55,10 +55,16 @@ | ||
| 55 | 55 | ** process. |
| 56 | 56 | ** |
| 57 | 57 | ** All work performance by the backoffice is in the backoffice_work() |
| 58 | 58 | ** routine. |
| 59 | 59 | */ |
| 60 | +#if defined(_WIN32) | |
| 61 | +# if defined(_WIN32_WINNT) | |
| 62 | +# undef _WIN32_WINNT | |
| 63 | +# endif | |
| 64 | +# define _WIN32_WINNT 0x501 | |
| 65 | +#endif | |
| 60 | 66 | #include "config.h" |
| 61 | 67 | #include "backoffice.h" |
| 62 | 68 | #include <time.h> |
| 63 | 69 | #if defined(_WIN32) |
| 64 | 70 | # include <windows.h> |
| @@ -621,12 +627,12 @@ | ||
| 621 | 627 | ax[4] = 0; |
| 622 | 628 | for(i=0; i<=3; i++) ax[i] = fossil_utf8_to_unicode(argv[i]); |
| 623 | 629 | x = _wspawnv(_P_NOWAIT, ax[0], (const wchar_t * const *)ax); |
| 624 | 630 | for(i=0; i<=3; i++) fossil_unicode_free(ax[i]); |
| 625 | 631 | backofficeTrace( |
| 626 | - "/***** Subprocess %d creates backoffice child %d *****/\n", | |
| 627 | - GETPID(), (int)x); | |
| 632 | + "/***** Subprocess %d creates backoffice child %lu *****/\n", | |
| 633 | + GETPID(), GetProcessId((HANDLE)x)); | |
| 628 | 634 | if( x>=0 ) return; |
| 629 | 635 | } |
| 630 | 636 | #else /* unix */ |
| 631 | 637 | { |
| 632 | 638 | pid_t pid = fork(); |
| @@ -645,10 +651,12 @@ | ||
| 645 | 651 | backoffice_thread(); |
| 646 | 652 | db_close(1); |
| 647 | 653 | backofficeTrace("/***** Backoffice Child %d exits *****/\n", GETPID()); |
| 648 | 654 | exit(0); |
| 649 | 655 | } |
| 656 | + fossil_warning("backoffice process %d fork failed, errno %d", GETPID(), | |
| 657 | + errno); | |
| 650 | 658 | } |
| 651 | 659 | #endif |
| 652 | 660 | /* Fork() failed or is unavailable. Run backoffice in this process, but |
| 653 | 661 | ** do so with the no-delay setting. |
| 654 | 662 | */ |
| 655 | 663 |
| --- src/backoffice.c | |
| +++ src/backoffice.c | |
| @@ -55,10 +55,16 @@ | |
| 55 | ** process. |
| 56 | ** |
| 57 | ** All work performance by the backoffice is in the backoffice_work() |
| 58 | ** routine. |
| 59 | */ |
| 60 | #include "config.h" |
| 61 | #include "backoffice.h" |
| 62 | #include <time.h> |
| 63 | #if defined(_WIN32) |
| 64 | # include <windows.h> |
| @@ -621,12 +627,12 @@ | |
| 621 | ax[4] = 0; |
| 622 | for(i=0; i<=3; i++) ax[i] = fossil_utf8_to_unicode(argv[i]); |
| 623 | x = _wspawnv(_P_NOWAIT, ax[0], (const wchar_t * const *)ax); |
| 624 | for(i=0; i<=3; i++) fossil_unicode_free(ax[i]); |
| 625 | backofficeTrace( |
| 626 | "/***** Subprocess %d creates backoffice child %d *****/\n", |
| 627 | GETPID(), (int)x); |
| 628 | if( x>=0 ) return; |
| 629 | } |
| 630 | #else /* unix */ |
| 631 | { |
| 632 | pid_t pid = fork(); |
| @@ -645,10 +651,12 @@ | |
| 645 | backoffice_thread(); |
| 646 | db_close(1); |
| 647 | backofficeTrace("/***** Backoffice Child %d exits *****/\n", GETPID()); |
| 648 | exit(0); |
| 649 | } |
| 650 | } |
| 651 | #endif |
| 652 | /* Fork() failed or is unavailable. Run backoffice in this process, but |
| 653 | ** do so with the no-delay setting. |
| 654 | */ |
| 655 |
| --- src/backoffice.c | |
| +++ src/backoffice.c | |
| @@ -55,10 +55,16 @@ | |
| 55 | ** process. |
| 56 | ** |
| 57 | ** All work performance by the backoffice is in the backoffice_work() |
| 58 | ** routine. |
| 59 | */ |
| 60 | #if defined(_WIN32) |
| 61 | # if defined(_WIN32_WINNT) |
| 62 | # undef _WIN32_WINNT |
| 63 | # endif |
| 64 | # define _WIN32_WINNT 0x501 |
| 65 | #endif |
| 66 | #include "config.h" |
| 67 | #include "backoffice.h" |
| 68 | #include <time.h> |
| 69 | #if defined(_WIN32) |
| 70 | # include <windows.h> |
| @@ -621,12 +627,12 @@ | |
| 627 | ax[4] = 0; |
| 628 | for(i=0; i<=3; i++) ax[i] = fossil_utf8_to_unicode(argv[i]); |
| 629 | x = _wspawnv(_P_NOWAIT, ax[0], (const wchar_t * const *)ax); |
| 630 | for(i=0; i<=3; i++) fossil_unicode_free(ax[i]); |
| 631 | backofficeTrace( |
| 632 | "/***** Subprocess %d creates backoffice child %lu *****/\n", |
| 633 | GETPID(), GetProcessId((HANDLE)x)); |
| 634 | if( x>=0 ) return; |
| 635 | } |
| 636 | #else /* unix */ |
| 637 | { |
| 638 | pid_t pid = fork(); |
| @@ -645,10 +651,12 @@ | |
| 651 | backoffice_thread(); |
| 652 | db_close(1); |
| 653 | backofficeTrace("/***** Backoffice Child %d exits *****/\n", GETPID()); |
| 654 | exit(0); |
| 655 | } |
| 656 | fossil_warning("backoffice process %d fork failed, errno %d", GETPID(), |
| 657 | errno); |
| 658 | } |
| 659 | #endif |
| 660 | /* Fork() failed or is unavailable. Run backoffice in this process, but |
| 661 | ** do so with the no-delay setting. |
| 662 | */ |
| 663 |