From d8bdbe234d7626622845eb84e2487e919a404a1c Mon Sep 17 00:00:00 2001 From: Ron Pedde Date: Sun, 9 Jul 2006 23:03:20 +0000 Subject: [PATCH] Fix erroneous startup message --- src/main.c | 4 ++-- src/os-win32.c | 23 ++++++++++++++++------- 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/src/main.c b/src/main.c index 890b16ee..b6292cf2 100644 --- a/src/main.c +++ b/src/main.c @@ -499,8 +499,8 @@ int main(int argc, char *argv[]) { DPRINTF(E_FATAL,L_MISC,"Error getting song count: %s\n",perr); } - DPRINTF(E_LOG,L_MAIN,"Scanned %d songs in %d seconds\n",song_count, - end_time-start_time); + DPRINTF(E_LOG,L_MAIN,"Serving %d songs. Startup complete in %d seconds\n", + song_count,end_time-start_time); if(conf_get_int("general","rescan_interval",0)) config.reload = 1; /* force a reload on start */ diff --git a/src/os-win32.c b/src/os-win32.c index 96f46a2b..eab60ada 100644 --- a/src/os-win32.c +++ b/src/os-win32.c @@ -34,6 +34,7 @@ static int _os_sock_to_fd(SOCKET sock); static void _os_lock(void); static void _os_unlock(void); static BOOL WINAPI _os_cancelhandler(DWORD dwCtrlType); +static void _os_phandle_dump(void); extern int gettimeout(struct timeval end,struct timeval *timeoutp); @@ -100,22 +101,29 @@ int os_init(int foreground, char *runas) { } /** - * shutdown the system-specific stuff started in os_init. + * dump pseudo-handles */ -void os_deinit(void) { +void _os_phandle_dump(void) { int fd; - - _os_socket_shutdown(); - /* walk through and log the different sockets */ - fd=0; + fd=1; /* skip the main listen socket */ while(fd < MAXDESC) { if(file_info[fd].state) { - DPRINTF(E_DBG,L_MISC,"Socket %d (%d): State %s\n",fd,fd+MAXDESC, + DPRINTF(E_LOG,L_MISC,"Socket %d (%d): State %s\n",fd,fd+MAXDESC, os_w32_socket_states[file_info[fd].state]); } fd++; } +} + +/** + * shutdown the system-specific stuff started in os_init. + */ +void os_deinit(void) { + + _os_socket_shutdown(); + + _os_phandle_dump(); if(os_serviceflag) { /* then we need to stop the service */ @@ -213,6 +221,7 @@ int _os_sock_to_fd(SOCKET sock) { if(fd == MAXDESC) { _os_unlock(); + _os_phandle_dump(); DPRINTF(E_FATAL,L_MISC,"Out of pseudo file handles. See ya\n"); }