public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [PATCH] open_posix_testsuite/.../sigset/{6, 7}-1.c: fix error handling
@ 2012-12-04 12:12 Jan Stancek
  2012-12-04 16:06 ` Garrett Cooper
  2012-12-05  1:08 ` Wanlong Gao
  0 siblings, 2 replies; 3+ messages in thread
From: Jan Stancek @ 2012-12-04 12:12 UTC (permalink / raw)
  To: ltp-list

int may not be large enough to hold return value from sigset():
  typedef void (*sighandler_t)(int);
  sighandler_t sigset(int sig, sighandler_t disp);

Signed-off-by: Jan Stancek <jstancek@redhat.com>
---
 .../conformance/interfaces/sigset/6-1.c            |    5 ++---
 .../conformance/interfaces/sigset/7-1.c            |    5 ++---
 2 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigset/6-1.c b/testcases/open_posix_testsuite/conformance/interfaces/sigset/6-1.c
index 16d340c..286ee37 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigset/6-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigset/6-1.c
@@ -48,9 +48,8 @@ int main(void)
 		return PTS_UNRESOLVED;
 	}
 
-	rc = sigset(SIGCHLD, SIG_HOLD);
-	if (rc < 0) {
-		ERR_MSG("sigset()", rc);
+	if (sigset(SIGCHLD, SIG_HOLD) == SIG_ERR) {
+		perror("Unexpected error while using sigset()");
 		return PTS_UNRESOLVED;
 	}
 
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigset/7-1.c b/testcases/open_posix_testsuite/conformance/interfaces/sigset/7-1.c
index b7230db..18d4bb4 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigset/7-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigset/7-1.c
@@ -56,9 +56,8 @@ int main(void)
 		return PTS_UNRESOLVED;
 	}
 
-	rc = sigset(SIGCHLD, SIG_HOLD);
-	if (rc < 0) {
-		ERR_MSG("sigset()", rc);
+	if (sigset(SIGCHLD, SIG_HOLD) == SIG_ERR) {
+		perror("Unexpected error while using sigset()");
 		return PTS_UNRESOLVED;
 	}
 
-- 
1.7.1


------------------------------------------------------------------------------
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-12-05  1:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-04 12:12 [LTP] [PATCH] open_posix_testsuite/.../sigset/{6, 7}-1.c: fix error handling Jan Stancek
2012-12-04 16:06 ` Garrett Cooper
2012-12-05  1:08 ` Wanlong Gao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox