[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Cluster-devel] fsck.gfs2: Use sigaction and not signal syscall



>From 97e49d3e55bcfce2fb2f8547528cf2f373e0843d Mon Sep 17 00:00:00 2001
From: Steven Whitehouse <swhiteho redhat com>
Date: Thu, 15 Dec 2011 10:36:51 +0000
Subject: [PATCH 1/2] fsck.gfs2: Use sigaction and not signal syscall

The signal syscall is obsolete and should not be used.

Signed-off-by: Steven Whitehouse <swhiteho redhat com>
---
 gfs2/fsck/main.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/gfs2/fsck/main.c b/gfs2/fsck/main.c
index d2a0965..aa354ad 100644
--- a/gfs2/fsck/main.c
+++ b/gfs2/fsck/main.c
@@ -228,6 +228,7 @@ int main(int argc, char **argv)
 	int j;
 	int error = 0;
 	int all_clean = 0;
+	struct sigaction act = { .sa_handler = interrupt, };
 
 	setlocale(LC_ALL, "");
 	textdomain("gfs2-utils");
@@ -247,7 +248,8 @@ int main(int argc, char **argv)
 		exit(FSCK_OK);
 	}
 
-	signal(SIGINT, interrupt);
+	sigaction(SIGINT, &act, NULL);
+
 	log_notice( _("Starting pass1\n"));
 	pass = "pass 1";
 	last_reported_block = 0;
-- 
1.7.4.4




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]