public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 1/2] posix: Handle success in gai_strerror()
@ 2023-06-10  7:16 Dridi Boukelmoune
  2023-06-10  7:16 ` [PATCH 2/2] posix: Add test case for gai_strerror() Dridi Boukelmoune
  2023-06-12 17:06 ` [PATCH 1/2] posix: Handle success in gai_strerror() Arjun Shankar
  0 siblings, 2 replies; 5+ messages in thread
From: Dridi Boukelmoune @ 2023-06-10  7:16 UTC (permalink / raw)
  To: libc-alpha; +Cc: Dridi Boukelmoune

Signed-off-by: Dridi Boukelmoune <dridi.boukelmoune@gmail.com>
---
 sysdeps/posix/gai_strerror-strs.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/sysdeps/posix/gai_strerror-strs.h b/sysdeps/posix/gai_strerror-strs.h
index 667c4b2d4a..cb497ff5ea 100644
--- a/sysdeps/posix/gai_strerror-strs.h
+++ b/sysdeps/posix/gai_strerror-strs.h
@@ -1,3 +1,4 @@
+_S(0, N_("Success"))
 _S(EAI_ADDRFAMILY, N_("Address family for hostname not supported"))
 _S(EAI_AGAIN, N_("Temporary failure in name resolution"))
 _S(EAI_BADFLAGS, N_("Bad value for ai_flags"))
-- 
2.40.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 2/2] posix: Add test case for gai_strerror()
  2023-06-10  7:16 [PATCH 1/2] posix: Handle success in gai_strerror() Dridi Boukelmoune
@ 2023-06-10  7:16 ` Dridi Boukelmoune
  2023-06-12 17:17   ` Arjun Shankar
  2023-06-12 17:06 ` [PATCH 1/2] posix: Handle success in gai_strerror() Arjun Shankar
  1 sibling, 1 reply; 5+ messages in thread
From: Dridi Boukelmoune @ 2023-06-10  7:16 UTC (permalink / raw)
  To: libc-alpha; +Cc: Dridi Boukelmoune

Signed-off-by: Dridi Boukelmoune <dridi.boukelmoune@gmail.com>
---
 posix/Makefile           |  1 +
 posix/tst-gai_strerror.c | 43 ++++++++++++++++++++++++++++++++++++++++
 2 files changed, 44 insertions(+)
 create mode 100644 posix/tst-gai_strerror.c

diff --git a/posix/Makefile b/posix/Makefile
index e19b74cd67..ad43cbdec6 100644
--- a/posix/Makefile
+++ b/posix/Makefile
@@ -275,6 +275,7 @@ tests := \
   tst-fnmatch6 \
   tst-fnmatch7 \
   tst-fork \
+  tst-gai_strerror \
   tst-getaddrinfo \
   tst-getaddrinfo2 \
   tst-getaddrinfo3 \
diff --git a/posix/tst-gai_strerror.c b/posix/tst-gai_strerror.c
new file mode 100644
index 0000000000..2b3c0e057a
--- /dev/null
+++ b/posix/tst-gai_strerror.c
@@ -0,0 +1,43 @@
+/* Test for gai_strerror()
+   Copyright (C) 2022-2023 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <https://www.gnu.org/licenses/>.  */
+
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netdb.h>
+#include <stdlib.h>
+#include <locale.h>
+
+#include <support/support.h>
+#include <support/check.h>
+
+static int
+do_test (void)
+{
+  unsetenv ("LANGUAGE");
+
+  xsetlocale (LC_ALL, "C");
+
+  TEST_COMPARE_STRING (gai_strerror (1), "Unknown error");
+  TEST_COMPARE_STRING (gai_strerror (0), "Success");
+  TEST_COMPARE_STRING (gai_strerror (EAI_OVERFLOW),
+                       "Result too large for supplied buffer");
+
+  return 0;
+}
+
+#include <support/test-driver.c>
-- 
2.40.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] posix: Handle success in gai_strerror()
  2023-06-10  7:16 [PATCH 1/2] posix: Handle success in gai_strerror() Dridi Boukelmoune
  2023-06-10  7:16 ` [PATCH 2/2] posix: Add test case for gai_strerror() Dridi Boukelmoune
@ 2023-06-12 17:06 ` Arjun Shankar
  1 sibling, 0 replies; 5+ messages in thread
From: Arjun Shankar @ 2023-06-12 17:06 UTC (permalink / raw)
  To: Dridi Boukelmoune; +Cc: libc-alpha

> Signed-off-by: Dridi Boukelmoune <dridi.boukelmoune@gmail.com>

Thanks for the patch! This looks good to me.

Reviewed-by: Arjun Shankar <arjun@redhat.com>

> ---
>  sysdeps/posix/gai_strerror-strs.h | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/sysdeps/posix/gai_strerror-strs.h b/sysdeps/posix/gai_strerror-strs.h
> index 667c4b2d4a..cb497ff5ea 100644
> --- a/sysdeps/posix/gai_strerror-strs.h
> +++ b/sysdeps/posix/gai_strerror-strs.h
> @@ -1,3 +1,4 @@
> +_S(0, N_("Success"))
>  _S(EAI_ADDRFAMILY, N_("Address family for hostname not supported"))
>  _S(EAI_AGAIN, N_("Temporary failure in name resolution"))
>  _S(EAI_BADFLAGS, N_("Bad value for ai_flags"))
> --
> 2.40.1
>


-- 
Arjun Shankar
he/him/his


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 2/2] posix: Add test case for gai_strerror()
  2023-06-10  7:16 ` [PATCH 2/2] posix: Add test case for gai_strerror() Dridi Boukelmoune
@ 2023-06-12 17:17   ` Arjun Shankar
  2023-06-13 10:10     ` Dridi Boukelmoune
  0 siblings, 1 reply; 5+ messages in thread
From: Arjun Shankar @ 2023-06-12 17:17 UTC (permalink / raw)
  To: Dridi Boukelmoune; +Cc: libc-alpha

> Signed-off-by: Dridi Boukelmoune <dridi.boukelmoune@gmail.com>

Thanks! This patch looks good except for the copyright line. Since
you're using a developer's certificate of origin, I assume you want to
contribute without assigning copyright to the FSF -- which is a
process you could go through if you so wish. In case you want to
contribute with a DCO, the copyright line in the new test will need to
be changed. More details here:
https://sourceware.org/glibc/wiki/Contribution%20checklist#Update_copyright_information

> ---
>  posix/Makefile           |  1 +
>  posix/tst-gai_strerror.c | 43 ++++++++++++++++++++++++++++++++++++++++
>  2 files changed, 44 insertions(+)
>  create mode 100644 posix/tst-gai_strerror.c
>
> diff --git a/posix/Makefile b/posix/Makefile
> index e19b74cd67..ad43cbdec6 100644
> --- a/posix/Makefile
> +++ b/posix/Makefile
> @@ -275,6 +275,7 @@ tests := \
>    tst-fnmatch6 \
>    tst-fnmatch7 \
>    tst-fork \
> +  tst-gai_strerror \

OK. Add test to Makefile.

>    tst-getaddrinfo \
>    tst-getaddrinfo2 \
>    tst-getaddrinfo3 \
> diff --git a/posix/tst-gai_strerror.c b/posix/tst-gai_strerror.c
> new file mode 100644
> index 0000000000..2b3c0e057a
> --- /dev/null
> +++ b/posix/tst-gai_strerror.c
> @@ -0,0 +1,43 @@
> +/* Test for gai_strerror()
> +   Copyright (C) 2022-2023 Free Software Foundation, Inc.

If you're contributing with a DCO, this will need editing to:

"Copyright The GNU Toolchain Authors."

> +   This file is part of the GNU C Library.
> +
> +   The GNU C Library is free software; you can redistribute it and/or
> +   modify it under the terms of the GNU Lesser General Public
> +   License as published by the Free Software Foundation; either
> +   version 2.1 of the License, or (at your option) any later version.
> +
> +   The GNU C Library is distributed in the hope that it will be useful,
> +   but WITHOUT ANY WARRANTY; without even the implied warranty of
> +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> +   Lesser General Public License for more details.
> +
> +   You should have received a copy of the GNU Lesser General Public
> +   License along with the GNU C Library; if not, see
> +   <https://www.gnu.org/licenses/>.  */
> +
> +#include <sys/types.h>
> +#include <sys/socket.h>
> +#include <netdb.h>
> +#include <stdlib.h>
> +#include <locale.h>
> +
> +#include <support/support.h>
> +#include <support/check.h>
> +
> +static int
> +do_test (void)
> +{
> +  unsetenv ("LANGUAGE");
> +
> +  xsetlocale (LC_ALL, "C");

OK.

> +
> +  TEST_COMPARE_STRING (gai_strerror (1), "Unknown error");
> +  TEST_COMPARE_STRING (gai_strerror (0), "Success");
> +  TEST_COMPARE_STRING (gai_strerror (EAI_OVERFLOW),
> +                       "Result too large for supplied buffer");

OK.

> +
> +  return 0;
> +}
> +
> +#include <support/test-driver.c>
> --
> 2.40.1
>


-- 
Arjun Shankar
he/him/his


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 2/2] posix: Add test case for gai_strerror()
  2023-06-12 17:17   ` Arjun Shankar
@ 2023-06-13 10:10     ` Dridi Boukelmoune
  0 siblings, 0 replies; 5+ messages in thread
From: Dridi Boukelmoune @ 2023-06-13 10:10 UTC (permalink / raw)
  To: Arjun Shankar; +Cc: libc-alpha

<snip>
> > +/* Test for gai_strerror()
> > +   Copyright (C) 2022-2023 Free Software Foundation, Inc.
>
> If you're contributing with a DCO, this will need editing to:
>
> "Copyright The GNU Toolchain Authors."

I didn't pay enough attention, new patch series submitted.

Thanks!
Dridi

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-06-13 10:11 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-10  7:16 [PATCH 1/2] posix: Handle success in gai_strerror() Dridi Boukelmoune
2023-06-10  7:16 ` [PATCH 2/2] posix: Add test case for gai_strerror() Dridi Boukelmoune
2023-06-12 17:17   ` Arjun Shankar
2023-06-13 10:10     ` Dridi Boukelmoune
2023-06-12 17:06 ` [PATCH 1/2] posix: Handle success in gai_strerror() Arjun Shankar

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).