public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Zack Weinberg <zack@sourceware.org>
To: glibc-cvs@sourceware.org
Subject: [glibc/zack/no-nested-includes] Don't include sys/types.h 3a/n: fixups for utmp{, x}.h
Date: Tue, 18 Jun 2019 15:34:00 -0000	[thread overview]
Message-ID: <20190618153427.50207.qmail@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=f4fd9e948e38fe90d9cd652ee1813d88b1a19b60

commit f4fd9e948e38fe90d9cd652ee1813d88b1a19b60
Author: Zack Weinberg <zackw@panix.com>
Date:   Sun May 26 10:44:34 2019 -0400

    Don't include sys/types.h 3a/n: fixups for utmp{,x}.h
    
    The conform tests expect utmpx.h to define time_t and suseconds_t.
    These are the public names for the types of the fields of struct timeval,
    and utmpx.h is required to define struct timeval, so this is a reasonable
    expectation even though POSIX doesn't _explicitly_ say it's also required
    to define time_t and suseconds_t.
    
    utmp.h is not a standard header but it makes sense for it to be as consistent
    with utmpx.h as possible, especially in our implementation where /var/log/utmp
    and /var/log/utmpx have the same format.
    
    	* login/utmp.h, login/utmpx.h: Include bits/types/suseconds_t.h
    	and bits/types/time_t.h.

Diff:
---
 login/utmp.h  | 2 ++
 login/utmpx.h | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/login/utmp.h b/login/utmp.h
index a689322..9c12e3c 100644
--- a/login/utmp.h
+++ b/login/utmp.h
@@ -25,6 +25,8 @@
    consistent.  */
 #include <bits/types.h>
 #include <bits/types/pid_t.h>
+#include <bits/types/suseconds_t.h>
+#include <bits/types/time_t.h>
 #include <bits/types/struct_timeval.h>
 
 /* Get system dependent values and data structures.  */
diff --git a/login/utmpx.h b/login/utmpx.h
index c2887b2..de18f58 100644
--- a/login/utmpx.h
+++ b/login/utmpx.h
@@ -23,6 +23,8 @@
 /* Required according to Unix98.  */
 #include <bits/types.h>
 #include <bits/types/pid_t.h>
+#include <bits/types/suseconds_t.h>
+#include <bits/types/time_t.h>
 #include <bits/types/struct_timeval.h>
 
 /* Get system dependent values and data structures.  */


             reply	other threads:[~2019-06-18 15:34 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-18 15:34 Zack Weinberg [this message]
  -- strict thread matches above, loose matches on Subject: below --
2019-05-26 16:37 Zack Weinberg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190618153427.50207.qmail@sourceware.org \
    --to=zack@sourceware.org \
    --cc=glibc-cvs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).