summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndreas Baumann <abaumann@yahoo.com>2009-03-27 14:05:55 +0100
committerAndreas Baumann <abaumann@yahoo.com>2009-03-27 14:05:55 +0100
commit1e30a5d2d995ab51cc27c00917cda37ef24295ff (patch)
treebe7004b85546c04ac889d861374c8d4d29b70470 /src
parent9fb045b62a3e2c9dfc5bb616bb80677e8568c64e (diff)
downloadwolfbones-1e30a5d2d995ab51cc27c00917cda37ef24295ff.tar.gz
wolfbones-1e30a5d2d995ab51cc27c00917cda37ef24295ff.tar.bz2
foreground mode of service, but without TERMINATE event
Diffstat (limited to 'src')
-rw-r--r--src/service/service.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/service/service.c b/src/service/service.c
index a7fb6b8..b8471ea 100644
--- a/src/service/service.c
+++ b/src/service/service.c
@@ -321,6 +321,15 @@ wolf_service_event_t wolf_service_events_suspend( int timeout, wolf_error_t *err
DWORD res;
char errbuf[512];
+ /* non-service mode, return after timeout */
+ /* TODO: how to catch stopping of console application and to send a terminate
+ * event? */
+ if( service_stop_event == NULL ) {
+ Sleep( timeout );
+ *error = WOLF_ERR_TIMEOUT;
+ return WOLF_SERVICE_NO_EVENT;
+ }
+
res = WaitForSingleObject( service_stop_event, timeout * 1000 );
switch( res ) {
case WAIT_OBJECT_0: