Introduced the Build ID in INFO and --version output.

The idea is to be able to identify a build in a unique way, so for
instance after a bug report we can recognize that the build is the one
of a popular Linux distribution and perform the debugging in the same
environment.
This commit is contained in:
antirez
2012-11-29 14:20:08 +01:00
parent b1b602a928
commit 2f62c9663c
9 changed files with 30 additions and 9 deletions

View File

@ -31,7 +31,11 @@
* small file is recompiled, as we access this information in all the other
* files using this functions. */
#include <string.h>
#include "release.h"
#include "version.h"
#include "crc64.h"
char *redisGitSHA1(void) {
return REDIS_GIT_SHA1;
@ -40,3 +44,9 @@ char *redisGitSHA1(void) {
char *redisGitDirty(void) {
return REDIS_GIT_DIRTY;
}
uint64_t redisBuildId(void) {
char *buildid = REDIS_VERSION REDIS_BUILD_ID REDIS_GIT_DIRTY REDIS_GIT_SHA1;
return crc64(0,(unsigned char*)buildid,strlen(buildid));
}