Fossil SCM

More enhancements to backoffice diagnostics.

mistachkin 2018-08-08 02:15 trunk
Commit 864a6f3922ed20829a196189c12edd8f2ed1a957273035e502dc8ba5ca1fbc2d
1 file changed +10 -2
+10 -2
--- src/backoffice.c
+++ src/backoffice.c
@@ -55,10 +55,16 @@
5555
** process.
5656
**
5757
** All work performance by the backoffice is in the backoffice_work()
5858
** routine.
5959
*/
60
+#if defined(_WIN32)
61
+# if defined(_WIN32_WINNT)
62
+# undef _WIN32_WINNT
63
+# endif
64
+# define _WIN32_WINNT 0x501
65
+#endif
6066
#include "config.h"
6167
#include "backoffice.h"
6268
#include <time.h>
6369
#if defined(_WIN32)
6470
# include <windows.h>
@@ -621,12 +627,12 @@
621627
ax[4] = 0;
622628
for(i=0; i<=3; i++) ax[i] = fossil_utf8_to_unicode(argv[i]);
623629
x = _wspawnv(_P_NOWAIT, ax[0], (const wchar_t * const *)ax);
624630
for(i=0; i<=3; i++) fossil_unicode_free(ax[i]);
625631
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));
628634
if( x>=0 ) return;
629635
}
630636
#else /* unix */
631637
{
632638
pid_t pid = fork();
@@ -645,10 +651,12 @@
645651
backoffice_thread();
646652
db_close(1);
647653
backofficeTrace("/***** Backoffice Child %d exits *****/\n", GETPID());
648654
exit(0);
649655
}
656
+ fossil_warning("backoffice process %d fork failed, errno %d", GETPID(),
657
+ errno);
650658
}
651659
#endif
652660
/* Fork() failed or is unavailable. Run backoffice in this process, but
653661
** do so with the no-delay setting.
654662
*/
655663
--- 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

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button