diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2013-07-19 02:45:27 -0400 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2013-07-19 02:45:49 -0400 |
commit | 6aaa8c2f783cd1b3ac27c5ce40625d032e7e3d71 (patch) | |
tree | 704a842601b5ce7ca739c1ab4ba0e675493cb734 /src/shared/specifier.c | |
parent | 61ad59b1314060958c6e1b1b480074e230b6ed3e (diff) |
core: add %v specifier
Diffstat (limited to 'src/shared/specifier.c')
-rw-r--r-- | src/shared/specifier.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/shared/specifier.c b/src/shared/specifier.c index 7577c91052..bb8859fdfd 100644 --- a/src/shared/specifier.c +++ b/src/shared/specifier.c @@ -20,6 +20,7 @@ ***/ #include <string.h> +#include <sys/utsname.h> #include "macro.h" #include "util.h" @@ -145,3 +146,14 @@ char *specifier_boot_id(char specifier, void *data, void *userdata) { char *specifier_host_name(char specifier, void *data, void *userdata) { return gethostname_malloc(); } + +char *specifier_kernel_release(char specifier, void *data, void *userdata) { + struct utsname uts; + int r; + + r = uname(&uts); + if (r < 0) + return NULL; + + return strdup(uts.release); +} |