diff options
author | Andrey Esin <gmlastik@gmail.com> | 2009-08-27 00:18:07 +0800 |
---|---|---|
committer | Leandro A. F. Pereira <leandro@hardinfo.org> | 2009-08-27 10:55:42 +0800 |
commit | 320113eae2bda4f16ffc5729911c2c58e142f808 (patch) | |
tree | 544d186d7d242b8c016c9073678187620217e391 | |
parent | e72031d655875beeebac612c66f7d8fbf42aebe2 (diff) |
get_os_compiled_date in os.h is the same function as
uname(&utsbuf);
utsbuf.version;
But i think it is not date of compiling kernel, because
lastik@llaptop:~$ uname -v
#45-Ubuntu SMP Tue Jun 30 19:49:51 UTC 2009
So i have renamed it in whole project in Kernel Version.
Signed-off-by: Leandro A. F. Pereira <leandro@hardinfo.org>
-rw-r--r-- | hardinfo2/arch/linux/common/os.h | 20 | ||||
-rw-r--r-- | hardinfo2/computer.c | 4 | ||||
-rw-r--r-- | hardinfo2/computer.h | 2 |
3 files changed, 4 insertions, 22 deletions
diff --git a/hardinfo2/arch/linux/common/os.h b/hardinfo2/arch/linux/common/os.h index 21f62296..e83b3f74 100644 --- a/hardinfo2/arch/linux/common/os.h +++ b/hardinfo2/arch/linux/common/os.h @@ -42,23 +42,6 @@ get_libc_version(void) return g_strdup("Unknown"); } -static gchar * -get_os_compiled_date(void) -{ - FILE *procversion; - gchar buf[512]; - - procversion = fopen("/proc/sys/kernel/version", "r"); - if (!procversion) - return g_strdup("Unknown"); - - (void)fgets(buf, 512, procversion); - fclose(procversion); - - return g_strdup(buf); -} - - #include <gdk/gdkx.h> void @@ -140,8 +123,6 @@ computer_get_os(void) os = g_new0(OperatingSystem, 1); - os->compiled_date = get_os_compiled_date(); - /* Attempt to get the Distribution name; try using /etc/lsb-release first, then doing the legacy method (checking for /etc/$DISTRO-release files) */ if (g_file_test("/etc/lsb-release", G_FILE_TEST_EXISTS)) { @@ -206,6 +187,7 @@ computer_get_os(void) /* Kernel and hostname info */ uname(&utsbuf); + os->kernel_version = g_strdup(utsbuf.version); os->kernel = g_strdup_printf("%s %s (%s)", utsbuf.sysname, utsbuf.release, utsbuf.machine); os->hostname = g_strdup(utsbuf.nodename); diff --git a/hardinfo2/computer.c b/hardinfo2/computer.c index 03cca574..3d5c6be4 100644 --- a/hardinfo2/computer.c +++ b/hardinfo2/computer.c @@ -416,7 +416,7 @@ gchar *callback_os() "UpdateInterval$Load Average=1000\n" "[Version]\n" "Kernel=%s\n" - "Compiled=%s\n" + "Version=%s\n" "C Library=%s\n" "Distribution=%s\n" "[Current Session]\n" @@ -429,7 +429,7 @@ gchar *callback_os() "Uptime=...\n" "Load Average=...", computer->os->kernel, - computer->os->compiled_date, + computer->os->kernel_version, computer->os->libc, computer->os->distro, computer->os->hostname, diff --git a/hardinfo2/computer.h b/hardinfo2/computer.h index e3ae6cf9..b1ff8452 100644 --- a/hardinfo2/computer.h +++ b/hardinfo2/computer.h @@ -140,7 +140,7 @@ struct _OperatingSystem { gchar *hostname; gchar *language; gchar *homedir; - gchar *compiled_date; + gchar *kernel_version; gchar *languages; |