Skip to content
Snippets Groups Projects
Commit 44af79c8 authored by rswindell's avatar rswindell
Browse files

Uses CVS revision instead of hardcoded version string.

parent ce53fb59
No related branches found
No related tags found
No related merge requests found
...@@ -69,7 +69,6 @@ ...@@ -69,7 +69,6 @@
#include "ident.h" /* identify() */ #include "ident.h" /* identify() */
/* Constants */ /* Constants */
#define SERVICES_VERSION "1.00"
#define MAX_SERVICES 128 #define MAX_SERVICES 128
#define TIMEOUT_THREAD_WAIT 60 /* Seconds */ #define TIMEOUT_THREAD_WAIT 60 /* Seconds */
...@@ -81,6 +80,7 @@ static int active_clients=0; ...@@ -81,6 +80,7 @@ static int active_clients=0;
static DWORD sockets=0; static DWORD sockets=0;
static BOOL terminated=FALSE; static BOOL terminated=FALSE;
static time_t uptime=0; static time_t uptime=0;
static char revision[16];
typedef struct { typedef struct {
/* These are sysop-configurable */ /* These are sysop-configurable */
...@@ -511,7 +511,7 @@ js_initcx(JSRuntime* js_runtime, SOCKET sock, service_client_t* service_client, ...@@ -511,7 +511,7 @@ js_initcx(JSRuntime* js_runtime, SOCKET sock, service_client_t* service_client,
,NULL,0))==NULL) ,NULL,0))==NULL)
break; break;
sprintf(ver,"Synchronet Services v%s",SERVICES_VERSION); sprintf(ver,"Synchronet Services %s",revision);
val = STRING_TO_JSVAL(JS_NewStringCopyZ(js_cx, ver)); val = STRING_TO_JSVAL(JS_NewStringCopyZ(js_cx, ver));
if(!JS_SetProperty(js_cx, server, "version", &val)) if(!JS_SetProperty(js_cx, server, "version", &val))
break; break;
...@@ -968,9 +968,11 @@ const char* DLLCALL services_ver(void) ...@@ -968,9 +968,11 @@ const char* DLLCALL services_ver(void)
DESCRIBE_COMPILER(compiler); DESCRIBE_COMPILER(compiler);
sprintf(ver,"Synchronet Services v%s%s " sscanf("$Revision$" + 11, "%s", revision);
sprintf(ver,"Synchronet Services %s%s "
"Compiled %s %s with %s" "Compiled %s %s with %s"
,SERVICES_VERSION ,revision
#ifdef _DEBUG #ifdef _DEBUG
," Debug" ," Debug"
#else #else
...@@ -1008,6 +1010,8 @@ void DLLCALL services_thread(void* arg) ...@@ -1008,6 +1010,8 @@ void DLLCALL services_thread(void* arg)
struct timeval tv; struct timeval tv;
service_client_t* client; service_client_t* client;
services_ver();
startup=(services_startup_t*)arg; startup=(services_startup_t*)arg;
if(startup==NULL) { if(startup==NULL) {
...@@ -1039,8 +1043,8 @@ void DLLCALL services_thread(void* arg) ...@@ -1039,8 +1043,8 @@ void DLLCALL services_thread(void* arg)
signal(SIGPIPE,SIG_IGN); signal(SIGPIPE,SIG_IGN);
#endif #endif
lprintf("Synchronet Services Version %s%s" lprintf("Synchronet Services %s%s"
,SERVICES_VERSION ,revision
#ifdef _DEBUG #ifdef _DEBUG
," Debug" ," Debug"
#else #else
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment