Skip to contentSkip to conversation

fsck.gfs2: Use sigaction and not signal syscall

Cluster-devel Steven Whitehouse 2 participants 2 messages Dec 15, 2011

lore
Share & tools
lore
#0 lore raw

From 97e49d3e55bcfce2fb2f8547528cf2f373e0843d Mon Sep 17 00:00:00 2001
From: Steven Whitehouse <[email protected]>
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.

---
 gfs2/fsck/main.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
gfs2/fsck/main.c +3 -1
index d2a0965..aa354ad 100644
@@ -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;
Signature · 1 line
1.7.4.4
#1 lore raw

----- Original Message -----

| >From 97e49d3e55bcfce2fb2f8547528cf2f373e0843d Mon Sep 17 00:00:00
| >2001
| From: Steven Whitehouse <[email protected]>
| 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 <[email protected]>
| ---

Hi,

ACK,

Regards,

Bob Peterson
Red Hat File Systems