diff mbox series

[2/5] signaltest: Remove drunk code

Message ID 20201110180036.859080-3-bigeasy@linutronix.de
State New
Headers show
Series rt-tests: Mostly signaltest clean up | expand

Commit Message

Sebastian Andrzej Siewior Nov. 10, 2020, 6 p.m. UTC
`oldtrace' is set for kernels prior 2.6.18. Remove "support" for them.

The alternative code (for new kernels) issues
	prctl(0, [01]);

which is not valid the kernel returns an error. I have no idea what its
purpose is, remove it.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
 src/signaltest/signaltest.c | 29 -----------------------------
 1 file changed, 29 deletions(-)
diff mbox series

Patch

diff --git a/src/signaltest/signaltest.c b/src/signaltest/signaltest.c
index 1cc3236a8f377..aceb714d3e9d3 100644
--- a/src/signaltest/signaltest.c
+++ b/src/signaltest/signaltest.c
@@ -62,7 +62,6 @@  struct thread_stat {
 
 static int shutdown;
 static int tracelimit;
-static int oldtrace;
 
 
 /*
@@ -105,13 +104,6 @@  void *signalthread(void *param)
 
 	stat->threadstarted++;
 
-	if (tracelimit) {
-		if (oldtrace)
-			gettimeofday(0, (struct timezone *)1);
-		else
-			prctl(0, 1);
-	}
-
 	clock_gettime(CLOCK_MONOTONIC, &before);
 
 	while (!shutdown) {
@@ -152,10 +144,6 @@  void *signalthread(void *param)
 
 		if (!stopped && tracelimit && (diff > tracelimit)) {
 			stopped++;
-			if (oldtrace)
-				gettimeofday(0, 0);
-			else
-				prctl(0, 0);
 			shutdown++;
 		}
 		stat->act = diff;
@@ -260,21 +248,6 @@  static void process_options(int argc, char *argv[])
 		display_help(error);
 }
 
-static void check_kernel(void)
-{
-	size_t len;
-	char ver[256];
-	int fd, maj, min, sub;
-
-	fd = open("/proc/version", O_RDONLY, 0666);
-	len = read(fd, ver, 255);
-	close(fd);
-	ver[len-1] = 0x0;
-	sscanf(ver, "Linux version %d.%d.%d", &maj, &min, &sub);
-	if (maj == 2 && min == 6 && sub < 18)
-		oldtrace = 1;
-}
-
 static void sighand(int sig)
 {
 	shutdown = 1;
@@ -323,8 +296,6 @@  int main(int argc, char **argv)
 			goto out;
 		}
 
-	check_kernel();
-
 	sigemptyset(&sigset);
 	sigaddset(&sigset, signum);
 	sigprocmask(SIG_BLOCK, &sigset, NULL);