diff options
author | Aaron Marcher <info@nulltime.net> | 2016-11-16 21:20:26 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-11-16 21:20:26 +0100 |
commit | 1a143566e60d63435c7504382a717e0503decb47 (patch) | |
tree | d6606a62db4a5b45415cb73b834768bf3706e46b /slstatus.c | |
parent | bcd5732b04d5b8b6572b2d1f122a2762316ea476 (diff) | |
parent | c3eb0c401200320151770680b9291197e759bfc9 (diff) |
Merge pull request #30 from TheMRod/master
Add a "uname -r" feature to see which kernel is running
Diffstat (limited to 'slstatus.c')
-rw-r--r-- | slstatus.c | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -20,6 +20,7 @@ #include <sys/socket.h> #include <sys/sysinfo.h> #include <sys/types.h> +#include <sys/utsname.h> #include <time.h> #include <unistd.h> #include <X11/Xlib.h> @@ -68,6 +69,7 @@ static char *username(void); static char *vol_perc(const char *card); static char *wifi_perc(const char *iface); static char *wifi_essid(const char *iface); +static char *kernel_release(void); static void set_status(const char *str); static void sighandler(const int signo); static void usage(void); @@ -721,6 +723,16 @@ wifi_essid(const char *iface) return smprintf("%s", (char *)wreq.u.essid.pointer); } +static char * +kernel_release(void) +{ + struct utsname udata; + if (uname(&udata) < 0) + return smprintf(UNKNOWN_STR); + + return smprintf("%s", udata.release); +} + static void set_status(const char *str) { |