all repos — slstatus @ 7392dbabebe69187618f31301a7842d4d2993966

my build of slstatus (tools.suckless.org/slstatus/)

kernel_release() coding style and position in code fix
Aaron Marcher info@nulltime.net
Wed, 28 Dec 2016 23:59:19 +0100
commit

7392dbabebe69187618f31301a7842d4d2993966

parent

1a143566e60d63435c7504382a717e0503decb47

1 files changed, 13 insertions(+), 11 deletions(-)

jump to
M slstatus.cslstatus.c

@@ -52,6 +52,7 @@ static char *entropy(void);

static char *gid(void); static char *hostname(void); static char *ip(const char *iface); +static char *kernel_release(void); static char *load_avg(void); static char *ram_free(void); static char *ram_perc(void);

@@ -69,7 +70,6 @@ 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);

@@ -314,6 +314,18 @@

freeifaddrs(ifaddr); return smprintf(UNKNOWN_STR); +} + +static char * +kernel_release(void) +{ + struct utsname udata; + + if (uname(&udata) < 0) { + return smprintf(UNKNOWN_STR); + } + + return smprintf("%s", udata.release); } static char *

@@ -721,16 +733,6 @@ if (strcmp((char *)wreq.u.essid.pointer, "") == 0)

return smprintf(UNKNOWN_STR); else 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