File bug-531508_rtcheck_slert_fix_for_2.6.31.patch of Package ibmrtpkgs
Index: rtcheck/Makefile
===================================================================
--- ibmrtpkgs-2.orig/rtcheck/Makefile 2009-08-18 15:56:06.000000000 -0600
+++ ibmrtpkgs-2/rtcheck/Makefile 2009-08-25 11:56:05.000000000 -0600
@@ -3,7 +3,7 @@
#
VER_MAJOR=0
-VER_MINOR=7.5
+VER_MINOR=7.6
DIST_TARGET=rtcheck-$(VER_MAJOR).$(VER_MINOR).tar.bz2
DIST_FILES=Makefile rtcheck.c rtcheck.init.rhel rtcheck.init.suse README CHANGELOG
Index: rtcheck/rtcheck.c
===================================================================
--- ibmrtpkgs-2.orig/rtcheck/rtcheck.c 2009-08-18 15:56:06.000000000 -0600
+++ ibmrtpkgs-2/rtcheck/rtcheck.c 2009-08-25 11:56:05.000000000 -0600
@@ -35,6 +35,7 @@
* 05/03/2007 - Revised for RHEL5-RT inclusion (v0.5)
* 05/08/2006 - Added verify_clockres to test whether or not clock
* resolution is within the acceptable range (<= 200us).
+ * 08/25/2009 - Changed the check for CONFIG_PREEMPT_RT to use uname
*/
#include <math.h>
@@ -54,6 +55,7 @@
#include <sys/mman.h>
#include <sys/stat.h>
#include <sys/resource.h>
+#include <sys/utsname.h>
#ifndef VERSION
#define VERSION ".dev"
@@ -232,13 +234,16 @@
{
int rc;
int ret = 0;
- struct stat stats;
+ struct utsname systeminfo;
- rc = system("test `ps ax | grep -E -e 'IRQ( |-)[1-9][0-9]*' | wc -l` -ne 0");
- if (WEXITSTATUS(rc) && stat("/proc/loadavgrt", &stats))
+ rc = uname(&systeminfo);
+ if (rc < 0)
+ perror("uname failed: ");
+
+ if (!strstr(systeminfo.version, "PREEMPT RT"))
ret = FAIL_PREEMPT_RT;
- PRINT_RESULT(" Checking for out-of-tree RT extensions", ret);
+ PRINT_RESULT(" Checking for PREEMPT_RT kernel", ret);
if (ret)
PRINT("\tKernel was not built with CONFIG_PREEMPT_RT=y\n");