Module Name:    src
Committed By:   joerg
Date:           Thu Feb 27 00:59:50 UTC 2014

Modified Files:
        src/tests/lib/libc/sys: t_msgctl.c t_msgget.c

Log Message:
Use an abs wide enough to cover the types involved.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/tests/lib/libc/sys/t_msgctl.c
cvs rdiff -u -r1.1 -r1.2 src/tests/lib/libc/sys/t_msgget.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/lib/libc/sys/t_msgctl.c
diff -u src/tests/lib/libc/sys/t_msgctl.c:1.3 src/tests/lib/libc/sys/t_msgctl.c:1.4
--- src/tests/lib/libc/sys/t_msgctl.c:1.3	Fri Nov 11 05:06:01 2011
+++ src/tests/lib/libc/sys/t_msgctl.c	Thu Feb 27 00:59:50 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: t_msgctl.c,v 1.3 2011/11/11 05:06:01 jruoho Exp $ */
+/* $NetBSD: t_msgctl.c,v 1.4 2014/02/27 00:59:50 joerg Exp $ */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: t_msgctl.c,v 1.3 2011/11/11 05:06:01 jruoho Exp $");
+__RCSID("$NetBSD: t_msgctl.c,v 1.4 2014/02/27 00:59:50 joerg Exp $");
 
 #include <sys/msg.h>
 #include <sys/stat.h>
@@ -316,7 +316,7 @@ ATF_TC_BODY(msgctl_time, tc)
 	(void)msgsnd(id, &msg, sizeof(struct msg), IPC_NOWAIT);
 	(void)msgctl(id, IPC_STAT, &msgds);
 
-	if (abs(t - msgds.msg_stime) > 1)
+	if (llabs(t - msgds.msg_stime) > 1)
 		atf_tc_fail("time of last msgsnd(2) was not updated");
 
 	if (msgds.msg_rtime != 0)
@@ -328,7 +328,7 @@ ATF_TC_BODY(msgctl_time, tc)
 	(void)msgrcv(id, &msg, sizeof(struct msg), MSG_MTYPE_1, IPC_NOWAIT);
 	(void)msgctl(id, IPC_STAT, &msgds);
 
-	if (abs(t - msgds.msg_rtime) > 1)
+	if (llabs(t - msgds.msg_rtime) > 1)
 		atf_tc_fail("time of last msgrcv(2) was not updated");
 
 	/*

Index: src/tests/lib/libc/sys/t_msgget.c
diff -u src/tests/lib/libc/sys/t_msgget.c:1.1 src/tests/lib/libc/sys/t_msgget.c:1.2
--- src/tests/lib/libc/sys/t_msgget.c:1.1	Sat Nov  5 07:45:41 2011
+++ src/tests/lib/libc/sys/t_msgget.c	Thu Feb 27 00:59:50 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: t_msgget.c,v 1.1 2011/11/05 07:45:41 jruoho Exp $ */
+/* $NetBSD: t_msgget.c,v 1.2 2014/02/27 00:59:50 joerg Exp $ */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: t_msgget.c,v 1.1 2011/11/05 07:45:41 jruoho Exp $");
+__RCSID("$NetBSD: t_msgget.c,v 1.2 2014/02/27 00:59:50 joerg Exp $");
 
 #include <sys/msg.h>
 #include <sys/stat.h>
@@ -178,7 +178,7 @@ ATF_TC_BODY(msgget_init, tc)
 	ATF_CHECK(msgds.msg_perm.cgid == gid);
 	ATF_CHECK(msgds.msg_perm.mode == 0600);
 
-	if (abs(t - msgds.msg_ctime) > 5)
+	if (llabs(t - msgds.msg_ctime) > 5)
 		atf_tc_fail("msgget(2) initialized current time incorrectly");
 
 	ATF_REQUIRE(msgctl(id, IPC_RMID, 0) == 0);

Reply via email to