summaryrefslogtreecommitdiff
path: root/slstatus.c
diff options
context:
space:
mode:
authorAaron Marcher <info@nulltime.net>2016-12-28 23:59:19 +0100
committerAaron Marcher <info@nulltime.net>2016-12-28 23:59:19 +0100
commit7392dbabebe69187618f31301a7842d4d2993966 (patch)
tree14c91f6cacd3f142d812f776f83a23de7a1af325 /slstatus.c
parent1a143566e60d63435c7504382a717e0503decb47 (diff)
kernel_release() coding style and position in code fix
Diffstat (limited to 'slstatus.c')
-rw-r--r--slstatus.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/slstatus.c b/slstatus.c
index 2b63be4..7ef9e23 100644
--- a/slstatus.c
+++ b/slstatus.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);
@@ -317,6 +317,18 @@ ip(const char *iface)
}
static char *
+kernel_release(void)
+{
+ struct utsname udata;
+
+ if (uname(&udata) < 0) {
+ return smprintf(UNKNOWN_STR);
+ }
+
+ return smprintf("%s", udata.release);
+}
+
+static char *
load_avg(void)
{
double avgs[3];
@@ -723,16 +735,6 @@ 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)
{