Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/tests/lib/libc/sys Use an abs wide enough to cover the types...



details:   https://anonhg.NetBSD.org/src/rev/7f08095434de
branches:  trunk
changeset: 327083:7f08095434de
user:      joerg <joerg%NetBSD.org@localhost>
date:      Thu Feb 27 00:59:50 2014 +0000

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

diffstat:

 tests/lib/libc/sys/t_msgctl.c |  8 ++++----
 tests/lib/libc/sys/t_msgget.c |  6 +++---
 2 files changed, 7 insertions(+), 7 deletions(-)

diffs (63 lines):

diff -r 523e49e370fe -r 7f08095434de tests/lib/libc/sys/t_msgctl.c
--- a/tests/lib/libc/sys/t_msgctl.c     Thu Feb 27 00:49:46 2014 +0000
+++ b/tests/lib/libc/sys/t_msgctl.c     Thu Feb 27 00:59:50 2014 +0000
@@ -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 @@
        (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 @@
        (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");
 
        /*
diff -r 523e49e370fe -r 7f08095434de tests/lib/libc/sys/t_msgget.c
--- a/tests/lib/libc/sys/t_msgget.c     Thu Feb 27 00:49:46 2014 +0000
+++ b/tests/lib/libc/sys/t_msgget.c     Thu Feb 27 00:59:50 2014 +0000
@@ -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_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);



Home | Main Index | Thread Index | Old Index