From 39ec8791f874a0a9a853aa1497099a57c1aa1dbc Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Thu, 15 Jan 2009 22:27:52 +0100 Subject: s3: make better use of ccache by not including version.h in every C-file. version.h changes rather frequently. Since it is included via includes.h, this means each C file will be a cache miss. This applies to the following situations: * When building a new package with a new Samba version * building in a git branch after calling mkversion.sh after a new commit (i.e. virtually always) This patch improves the situation in the following way: * remove inlude "version.h" from includes.h * Use samba_version_string() instead of SAMBA_VERSION_STRING in files that use no other macro from version.h instead of SAMBA_VERSION_STRING. * explicitly include "version.h" in those files that use more macros from "version.h" than just SAMBA_VERSION_STRING. Michael --- source3/smbd/server.c | 2 +- source3/smbd/sesssetup.c | 2 +- source3/smbd/trans2.c | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) (limited to 'source3/smbd') diff --git a/source3/smbd/server.c b/source3/smbd/server.c index 6be8e9b83e..00e939e2b8 100644 --- a/source3/smbd/server.c +++ b/source3/smbd/server.c @@ -1231,7 +1231,7 @@ extern void build_options(bool screen); reopen_logs(); - DEBUG(0,("smbd version %s started.\n", SAMBA_VERSION_STRING)); + DEBUG(0,("smbd version %s started.\n", samba_version_string())); DEBUGADD(0,("%s\n", COPYRIGHT_STARTUP_MESSAGE)); DEBUG(2,("uid=%d gid=%d euid=%d egid=%d\n", diff --git a/source3/smbd/sesssetup.c b/source3/smbd/sesssetup.c index b8e0c86833..a2ad56bea1 100644 --- a/source3/smbd/sesssetup.c +++ b/source3/smbd/sesssetup.c @@ -71,7 +71,7 @@ static int push_signature(uint8 **outbuf) if (tmp == -1) return -1; result += tmp; - if (asprintf(&lanman, "Samba %s", SAMBA_VERSION_STRING) != -1) { + if (asprintf(&lanman, "Samba %s", samba_version_string()) != -1) { tmp = message_push_string(outbuf, lanman, STR_TERMINATE); SAFE_FREE(lanman); } diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c index 9644e3d1ad..52340d5370 100644 --- a/source3/smbd/trans2.c +++ b/source3/smbd/trans2.c @@ -24,6 +24,7 @@ */ #include "includes.h" +#include "version.h" #include "smbd/globals.h" extern enum protocol_types Protocol; -- cgit