Skip to content

Commit

Permalink
New "os" field in INFO output providing information about the operati…
Browse files Browse the repository at this point in the history
…ng system.
  • Loading branch information
antirez committed Apr 4, 2012
1 parent bb0fbc8 commit 5ad1faa
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/redis.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
#include <float.h>
#include <math.h>
#include <sys/resource.h>
#include <sys/utsname.h>

/* Our shared "common" objects */

Expand Down Expand Up @@ -1739,12 +1740,16 @@ sds genRedisInfoString(char *section) {

/* Server */
if (allsections || defsections || !strcasecmp(section,"server")) {
struct utsname name;

if (sections++) info = sdscat(info,"\r\n");
uname(&name);
info = sdscatprintf(info,
"# Server\r\n"
"redis_version:%s\r\n"
"redis_git_sha1:%s\r\n"
"redis_git_dirty:%d\r\n"
"os:%s %s %s\r\n"
"arch_bits:%d\r\n"
"multiplexing_api:%s\r\n"
"gcc_version:%d.%d.%d\r\n"
Expand All @@ -1757,6 +1762,7 @@ sds genRedisInfoString(char *section) {
REDIS_VERSION,
redisGitSHA1(),
strtol(redisGitDirty(),NULL,10) > 0,
name.sysname, name.release, name.machine,
server.arch_bits,
aeGetApiName(),
#ifdef __GNUC__
Expand Down

0 comments on commit 5ad1faa

Please sign in to comment.