NetBSD Problem Report #51849

From www@NetBSD.org  Fri Jan 13 05:53:11 2017
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.netbsd.org", Issuer "Postmaster NetBSD.org" (verified OK))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 7C0947A26A
	for <gnats-bugs@gnats.NetBSD.org>; Fri, 13 Jan 2017 05:53:11 +0000 (UTC)
Message-Id: <20170113055310.844947A2A1@mollari.NetBSD.org>
Date: Fri, 13 Jan 2017 05:53:10 +0000 (UTC)
From: yaneurabeya@gmail.com
Reply-To: yaneurabeya@gmail.com
To: gnats-bugs@NetBSD.org
Subject: [PATCH] tests/lib/libc/sys/t_clock_gettime: headers portability fixes
X-Send-Pr-Version: www-1.0

>Number:         51849
>Category:       bin
>Synopsis:       [PATCH] tests/lib/libc/sys/t_clock_gettime: headers portability fixes
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Jan 13 05:55:00 +0000 2017
>Closed-Date:    Mon Jan 16 19:02:57 +0000 2017
>Last-Modified:  Mon Jan 16 19:02:57 +0000 2017
>Originator:     Ngie Cooper
>Release:        7.0.2
>Organization:
>Environment:
n/a
>Description:
- Use portable replacements for machine/int_limits.h.
- Use CPPFLAGS and non-relative path to h_macros.h.
>How-To-Repeat:

>Fix:

>Release-Note:

>Audit-Trail:
From: "Ngie Cooper (yaneurabeya)" <yaneurabeya@gmail.com>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: bin/51849: [PATCH] tests/lib/libc/sys/t_clock_gettime: headers
 portability fixes
Date: Thu, 12 Jan 2017 22:05:29 -0800

 --Apple-Mail=_674FABB8-1555-4CA7-87A5-998C7E10BF6D
 Content-Transfer-Encoding: 7bit
 Content-Type: text/plain;
 	charset=us-ascii

 Patch attached.
 -Ngie

 --Apple-Mail=_674FABB8-1555-4CA7-87A5-998C7E10BF6D
 Content-Disposition: attachment;
 	filename=t_clock_gettime-use-portable-includes.patch
 Content-Type: application/octet-stream;
 	x-unix-mode=0644;
 	name="t_clock_gettime-use-portable-includes.patch"
 Content-Transfer-Encoding: 7bit

 Index: lib/libc/sys/t_clock_gettime.c
 ===================================================================
 RCS file: /cvsroot/src/tests/lib/libc/sys/t_clock_gettime.c,v
 retrieving revision 1.1
 diff -u -r1.1 t_clock_gettime.c
 --- lib/libc/sys/t_clock_gettime.c	15 Oct 2011 06:42:16 -0000	1.1
 +++ lib/libc/sys/t_clock_gettime.c	13 Jan 2017 05:52:13 -0000
 @@ -63,17 +63,18 @@
  #include <sys/param.h>
  #include <sys/sysctl.h>

 -#include <machine/int_limits.h>

  #include <atf-c.h>
  #include <errno.h>
 +#include <limits.h>
  #include <stdio.h>
 +#include <stdint.h>
  #include <stdlib.h>
  #include <string.h>
  #include <time.h>
  #include <unistd.h>

 -#include "../../../h_macros.h"
 +#include "h_macros.h"

  #define MINPOSDIFF	15000000	/* 15 ms for now */
  #define TIMEOUT		5
 Index: lib/libc/sys/Makefile
 ===================================================================
 RCS file: /cvsroot/src/tests/lib/libc/sys/Makefile,v
 retrieving revision 1.45
 diff -u -r1.45 Makefile
 --- lib/libc/sys/Makefile	11 Nov 2016 15:30:44 -0000	1.45
 +++ lib/libc/sys/Makefile	13 Jan 2017 05:52:13 -0000
 @@ -82,6 +82,7 @@
  LDADD.t_posix_fadvise+= -lrumpvfs -lrump -lrumpuser -lrump -lpthread
  .endif

 +CPPFLAGS.t_clock_gettime.c+=	-I${.CURDIR:H:H:H}
  CPPFLAGS.t_lwp_create.c += -D_KERNTYPES

  WARNS=			4

 --Apple-Mail=_674FABB8-1555-4CA7-87A5-998C7E10BF6D--

From: "Christos Zoulas" <christos@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/51849 CVS commit: src/tests/lib/libc/sys
Date: Fri, 13 Jan 2017 15:10:57 -0500

 Module Name:	src
 Committed By:	christos
 Date:		Fri Jan 13 20:10:57 UTC 2017

 Modified Files:
 	src/tests/lib/libc/sys: t_clock_gettime.c

 Log Message:
 PR/51849: Ngie Cooper: headers portability fixes


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

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

State-Changed-From-To: open->closed
State-Changed-By: snj@NetBSD.org
State-Changed-When: Mon, 16 Jan 2017 19:02:57 +0000
State-Changed-Why:
christos committed it (with a different fix for the h_macros.h issue).
thanks!


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2014 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.