* [hurd,commited 0/3] hurd: fix building tests
@ 2018-01-28 18:40 Samuel Thibault
2018-01-28 18:40 ` [hurd,commited 3/3] hurd: Fix building io/tst-copy_file_range.c Samuel Thibault
` (2 more replies)
0 siblings, 3 replies; 10+ messages in thread
From: Samuel Thibault @ 2018-01-28 18:40 UTC (permalink / raw)
To: libc-alpha; +Cc: Samuel Thibault
These are small fixes for building tests on GNU/Hurd
Samuel Thibault (3):
hurd: Fix building libio/tst-memstream3.c
hurd: Fix building io/tst-fchownat.c
hurd: Fix building io/tst-copy_file_range.c
ChangeLog | 7 +++++++
io/tst-copy_file_range.c | 4 +++-
io/tst-fchownat.c | 2 +-
libio/tst-memstream3.c | 10 +++++-----
libio/tst-wmemstream3.c | 2 +-
5 files changed, 17 insertions(+), 8 deletions(-)
--
2.15.1
^ permalink raw reply [flat|nested] 10+ messages in thread
* [hurd,commited 3/3] hurd: Fix building io/tst-copy_file_range.c
2018-01-28 18:40 [hurd,commited 0/3] hurd: fix building tests Samuel Thibault
@ 2018-01-28 18:40 ` Samuel Thibault
2018-01-28 22:50 ` [hurd,commited 1/3] hurd: Fix building libio/tst-memstream3.c Samuel Thibault
2018-01-28 23:02 ` [hurd,commited 2/3] hurd: Fix building io/tst-fchownat.c Samuel Thibault
2 siblings, 0 replies; 10+ messages in thread
From: Samuel Thibault @ 2018-01-28 18:40 UTC (permalink / raw)
To: libc-alpha; +Cc: Samuel Thibault
* io/tst-copy_file_range.c [!defined CLONE_NEWNS]: Do not include
<sys/mount.h>.
---
ChangeLog | 2 ++
io/tst-copy_file_range.c | 4 +++-
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/ChangeLog b/ChangeLog
index 23058435c4..961262d654 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -58,6 +58,8 @@
* libio/tst-wmemstream3.c (FWRITE): Rename accordingly.
* io/tst-fchownat.c [!defined _POSIX_CHOWN_RESTRICTED]: Act like when
_POSIX_CHOWN_RESTRICTED is defined to 0.
+ * io/tst-copy_file_range.c [!defined CLONE_NEWNS]: Do not include
+ <sys/mount.h>.
2008-12-18 Thomas Schwinge <tschwinge@gnu.org>
diff --git a/io/tst-copy_file_range.c b/io/tst-copy_file_range.c
index f1cab1252d..3d531a1937 100644
--- a/io/tst-copy_file_range.c
+++ b/io/tst-copy_file_range.c
@@ -33,7 +33,9 @@
#include <support/temp_file.h>
#include <support/test-driver.h>
#include <support/xunistd.h>
-#include <sys/mount.h>
+#ifdef CLONE_NEWNS
+# include <sys/mount.h>
+#endif
/* Boolean flags which indicate whether to use pointers with explicit
output flags. */
--
2.15.1
^ permalink raw reply [flat|nested] 10+ messages in thread
* [hurd,commited 1/3] hurd: Fix building libio/tst-memstream3.c
2018-01-28 18:40 [hurd,commited 0/3] hurd: fix building tests Samuel Thibault
2018-01-28 18:40 ` [hurd,commited 3/3] hurd: Fix building io/tst-copy_file_range.c Samuel Thibault
@ 2018-01-28 22:50 ` Samuel Thibault
2018-01-29 21:03 ` Joseph Myers
2018-01-28 23:02 ` [hurd,commited 2/3] hurd: Fix building io/tst-fchownat.c Samuel Thibault
2 siblings, 1 reply; 10+ messages in thread
From: Samuel Thibault @ 2018-01-28 22:50 UTC (permalink / raw)
To: libc-alpha; +Cc: Samuel Thibault
FWRITE is already an fcntl.h macro.
* libio/tst-memstream3.c (FWRITE): Rename to _FWRITE.
(do_test_bz20181): Rename accordingly.
* libio/tst-wmemstream3.c (FWRITE): Rename accordingly.
---
ChangeLog | 3 +++
libio/tst-memstream3.c | 10 +++++-----
libio/tst-wmemstream3.c | 2 +-
3 files changed, 9 insertions(+), 6 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 1261148996..23a56d69cd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -53,6 +53,9 @@
* sysdeps/mach/hurd/check_pf.c: New file.
* sysdeps/mach/hurd/libhurduser.abilist: New file.
* sysdeps/mach/libmachuser.abilist: New file.
+ * libio/tst-memstream3.c (FWRITE): Rename to _FWRITE.
+ (do_test_bz20181): Rename accordingly.
+ * libio/tst-wmemstream3.c (FWRITE): Rename accordingly.
2008-12-18 Thomas Schwinge <tschwinge@gnu.org>
diff --git a/libio/tst-memstream3.c b/libio/tst-memstream3.c
index 331314f784..df0da5bac5 100644
--- a/libio/tst-memstream3.c
+++ b/libio/tst-memstream3.c
@@ -29,7 +29,7 @@
# define W(o) o
# define OPEN_MEMSTREAM open_memstream
# define PRINTF printf
-# define FWRITE fwrite
+# define _FWRITE fwrite
# define FPUTC fputc
# define STRCMP strcmp
#endif
@@ -114,14 +114,14 @@ do_test_bz20181 (void)
if (fp == NULL)
ERROR_RET1 ("%s failed\n", S(OPEN_MEMSTREAM));
- if ((ret = FWRITE (W("abc"), 1, 3, fp)) != 3)
- ERROR_RET1 ("%s failed (errno = %d)\n", S(FWRITE), errno);
+ if ((ret = _FWRITE (W("abc"), 1, 3, fp)) != 3)
+ ERROR_RET1 ("%s failed (errno = %d)\n", S(_FWRITE), errno);
if (fseek (fp, 0, SEEK_SET) != 0)
ERROR_RET1 ("fseek failed (errno = %d)\n", errno);
- if (FWRITE (W("z"), 1, 1, fp) != 1)
- ERROR_RET1 ("%s failed (errno = %d)\n", S(FWRITE), errno);
+ if (_FWRITE (W("z"), 1, 1, fp) != 1)
+ ERROR_RET1 ("%s failed (errno = %d)\n", S(_FWRITE), errno);
if (fflush (fp) != 0)
ERROR_RET1 ("fflush failed (errno = %d)\n", errno);
diff --git a/libio/tst-wmemstream3.c b/libio/tst-wmemstream3.c
index d0e4973768..4edc2b9094 100644
--- a/libio/tst-wmemstream3.c
+++ b/libio/tst-wmemstream3.c
@@ -37,7 +37,7 @@ fwwrite (const void *ptr, size_t size, size_t nmemb, FILE *arq)
#define W(o) L##o
#define OPEN_MEMSTREAM open_wmemstream
#define PRINTF wprintf
-#define FWRITE fwwrite
+#define _FWRITE fwwrite
#define FPUTC fputwc
#define STRCMP wcscmp
--
2.15.1
^ permalink raw reply [flat|nested] 10+ messages in thread
* [hurd,commited 2/3] hurd: Fix building io/tst-fchownat.c
2018-01-28 18:40 [hurd,commited 0/3] hurd: fix building tests Samuel Thibault
2018-01-28 18:40 ` [hurd,commited 3/3] hurd: Fix building io/tst-copy_file_range.c Samuel Thibault
2018-01-28 22:50 ` [hurd,commited 1/3] hurd: Fix building libio/tst-memstream3.c Samuel Thibault
@ 2018-01-28 23:02 ` Samuel Thibault
2018-01-28 23:07 ` Andreas Schwab
2 siblings, 1 reply; 10+ messages in thread
From: Samuel Thibault @ 2018-01-28 23:02 UTC (permalink / raw)
To: libc-alpha; +Cc: Samuel Thibault
* io/tst-fchownat.c [!defined _POSIX_CHOWN_RESTRICTED]: Act like when
_POSIX_CHOWN_RESTRICTED is defined to 0.
---
ChangeLog | 2 ++
io/tst-fchownat.c | 2 +-
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/ChangeLog b/ChangeLog
index 23a56d69cd..23058435c4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -56,6 +56,8 @@
* libio/tst-memstream3.c (FWRITE): Rename to _FWRITE.
(do_test_bz20181): Rename accordingly.
* libio/tst-wmemstream3.c (FWRITE): Rename accordingly.
+ * io/tst-fchownat.c [!defined _POSIX_CHOWN_RESTRICTED]: Act like when
+ _POSIX_CHOWN_RESTRICTED is defined to 0.
2008-12-18 Thomas Schwinge <tschwinge@gnu.org>
diff --git a/io/tst-fchownat.c b/io/tst-fchownat.c
index e8adf6229f..8318842249 100644
--- a/io/tst-fchownat.c
+++ b/io/tst-fchownat.c
@@ -20,7 +20,7 @@ static int dir_fd;
static void
prepare (void)
{
-#if _POSIX_CHOWN_RESTRICTED == 0
+#if !defined _POSIX_CHOWN_RESTRICTED || _POSIX_CHOWN_RESTRICTED == 0
if (pathconf (test_dir, _PC_CHOWN_RESTRICTED) != 0)
#endif
{
--
2.15.1
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [hurd,commited 2/3] hurd: Fix building io/tst-fchownat.c
2018-01-28 23:02 ` [hurd,commited 2/3] hurd: Fix building io/tst-fchownat.c Samuel Thibault
@ 2018-01-28 23:07 ` Andreas Schwab
2018-01-28 23:27 ` Samuel Thibault
0 siblings, 1 reply; 10+ messages in thread
From: Andreas Schwab @ 2018-01-28 23:07 UTC (permalink / raw)
To: Samuel Thibault; +Cc: libc-alpha
On Jan 28 2018, Samuel Thibault <samuel.thibault@ens-lyon.org> wrote:
> * io/tst-fchownat.c [!defined _POSIX_CHOWN_RESTRICTED]: Act like when
> _POSIX_CHOWN_RESTRICTED is defined to 0.
_POSIX_CHOWN_RESTRICTED must not be undefined (and undefined is _not_
the same as 0). Fix the hurd header instead.
Andreas.
--
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [hurd,commited 2/3] hurd: Fix building io/tst-fchownat.c
2018-01-28 23:07 ` Andreas Schwab
@ 2018-01-28 23:27 ` Samuel Thibault
2018-01-29 10:11 ` Samuel Thibault
0 siblings, 1 reply; 10+ messages in thread
From: Samuel Thibault @ 2018-01-28 23:27 UTC (permalink / raw)
To: Andreas Schwab; +Cc: libc-alpha
Andreas Schwab, on dim. 28 janv. 2018 18:35:37 +0100, wrote:
> On Jan 28 2018, Samuel Thibault <samuel.thibault@ens-lyon.org> wrote:
>
> > * io/tst-fchownat.c [!defined _POSIX_CHOWN_RESTRICTED]: Act like when
> > _POSIX_CHOWN_RESTRICTED is defined to 0.
>
> _POSIX_CHOWN_RESTRICTED must not be undefined (and undefined is _not_
> the same as 0). Fix the hurd header instead.
So the #ifdef in posix/fpathconf.c should be dropped?
Samuel
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [hurd,commited 2/3] hurd: Fix building io/tst-fchownat.c
2018-01-28 23:27 ` Samuel Thibault
@ 2018-01-29 10:11 ` Samuel Thibault
0 siblings, 0 replies; 10+ messages in thread
From: Samuel Thibault @ 2018-01-29 10:11 UTC (permalink / raw)
To: Andreas Schwab; +Cc: libc-alpha
Samuel Thibault, on dim. 28 janv. 2018 18:37:17 +0100, wrote:
> Andreas Schwab, on dim. 28 janv. 2018 18:35:37 +0100, wrote:
> > On Jan 28 2018, Samuel Thibault <samuel.thibault@ens-lyon.org> wrote:
> >
> > > * io/tst-fchownat.c [!defined _POSIX_CHOWN_RESTRICTED]: Act like when
> > > _POSIX_CHOWN_RESTRICTED is defined to 0.
> >
> > _POSIX_CHOWN_RESTRICTED must not be undefined (and undefined is _not_
> > the same as 0). Fix the hurd header instead.
>
> So the #ifdef in posix/fpathconf.c should be dropped?
I have reverted it.
Samuel
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [hurd,commited 1/3] hurd: Fix building libio/tst-memstream3.c
2018-01-28 22:50 ` [hurd,commited 1/3] hurd: Fix building libio/tst-memstream3.c Samuel Thibault
@ 2018-01-29 21:03 ` Joseph Myers
2018-01-29 23:58 ` Samuel Thibault
0 siblings, 1 reply; 10+ messages in thread
From: Joseph Myers @ 2018-01-29 21:03 UTC (permalink / raw)
To: Samuel Thibault; +Cc: libc-alpha
On Sun, 28 Jan 2018, Samuel Thibault wrote:
> FWRITE is already an fcntl.h macro.
>
> * libio/tst-memstream3.c (FWRITE): Rename to _FWRITE.
> (do_test_bz20181): Rename accordingly.
> * libio/tst-wmemstream3.c (FWRITE): Rename accordingly.
I think we should leave the testcase using FWRITE (and certainly not make
tests use reserved-namespace names with leading '_' if it can be avoided),
and instead remove the FREAD and FWRITE macros from the generic and Hurd
bits/fcntl.h.
(There's a case for removing all the F* aliases for O_* from all
bits/fcntl.h variants, as one of many likely obsolete __USE_MISC APIs, but
that would need more investigation of how widely used they might be.
Removal of names that only appear in the Hurd-specific and (currently
unused) generic headers is pretty safe, however.)
--
Joseph S. Myers
joseph@codesourcery.com
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [hurd,commited 1/3] hurd: Fix building libio/tst-memstream3.c
2018-01-29 21:03 ` Joseph Myers
@ 2018-01-29 23:58 ` Samuel Thibault
2018-01-30 0:05 ` Joseph Myers
0 siblings, 1 reply; 10+ messages in thread
From: Samuel Thibault @ 2018-01-29 23:58 UTC (permalink / raw)
To: Joseph Myers; +Cc: libc-alpha
Joseph Myers, on lun. 29 janv. 2018 16:33:40 +0000, wrote:
> and instead remove the FREAD and FWRITE macros from the generic and Hurd
> bits/fcntl.h.
What do we do of sysdeps/unix/bsd/tcflush.c's use of FREAD and FWRITE
then?
Samuel
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [hurd,commited 1/3] hurd: Fix building libio/tst-memstream3.c
2018-01-29 23:58 ` Samuel Thibault
@ 2018-01-30 0:05 ` Joseph Myers
0 siblings, 0 replies; 10+ messages in thread
From: Joseph Myers @ 2018-01-30 0:05 UTC (permalink / raw)
To: Samuel Thibault; +Cc: libc-alpha
On Mon, 29 Jan 2018, Samuel Thibault wrote:
> Joseph Myers, on lun. 29 janv. 2018 16:33:40 +0000, wrote:
> > and instead remove the FREAD and FWRITE macros from the generic and Hurd
> > bits/fcntl.h.
>
> What do we do of sysdeps/unix/bsd/tcflush.c's use of FREAD and FWRITE
> then?
I would have said change it to use O_RDONLY and O_WRONLY of which FREAD
and FWRITE are aliases, but in the generic header they aren't aliases.
The comments in both bits/fcntl.h headers, referring to those names as
being for bits returned by F_GETFL, are clearly wrong - F_GETFL returns
the O_* bits, not some possibly rewritten bits. So maybe those macros
should stay, but with the comments in both places changed to say they are
flags for TIOCFLUSH (e.g. FreeBSD's fcntl.h has a comment referring to
TIOCFLUSH above the definition of those macros). And then use a name such
as FWRITE_FUNC in the tests, since they still shouldn't be using
implementation-namespace _FWRITE.
--
Joseph S. Myers
joseph@codesourcery.com
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2018-01-29 21:32 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-28 18:40 [hurd,commited 0/3] hurd: fix building tests Samuel Thibault
2018-01-28 18:40 ` [hurd,commited 3/3] hurd: Fix building io/tst-copy_file_range.c Samuel Thibault
2018-01-28 22:50 ` [hurd,commited 1/3] hurd: Fix building libio/tst-memstream3.c Samuel Thibault
2018-01-29 21:03 ` Joseph Myers
2018-01-29 23:58 ` Samuel Thibault
2018-01-30 0:05 ` Joseph Myers
2018-01-28 23:02 ` [hurd,commited 2/3] hurd: Fix building io/tst-fchownat.c Samuel Thibault
2018-01-28 23:07 ` Andreas Schwab
2018-01-28 23:27 ` Samuel Thibault
2018-01-29 10:11 ` Samuel Thibault
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).