summaryrefslogtreecommitdiff
path: root/src/shared/specifier.c
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2013-07-19 02:45:27 -0400
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2013-07-19 02:45:49 -0400
commit6aaa8c2f783cd1b3ac27c5ce40625d032e7e3d71 (patch)
tree704a842601b5ce7ca739c1ab4ba0e675493cb734 /src/shared/specifier.c
parent61ad59b1314060958c6e1b1b480074e230b6ed3e (diff)
core: add %v specifier
Diffstat (limited to 'src/shared/specifier.c')
-rw-r--r--src/shared/specifier.c12
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);
+}