]> Savannah Git Hosting - gnulib.git/commitdiff
ptsname_r: Work around ptsname_r bug on Solaris 11 OmniOS.
authorCollin Funk <collin.funk1@gmail.com>
Sat, 25 Jan 2025 05:36:11 +0000 (21:36 -0800)
committerBruno Haible <bruno@clisp.org>
Sun, 2 Feb 2025 10:00:32 +0000 (11:00 +0100)
* lib/ptsname_r.c (ptsname_r): Ensure the resulting buffer is not
clobbered if it is too small on Solaris 11 OmniOS.
* m4/ptsname_r.m4 (gl_FUNC_PTSNAME_R): On Solaris 11 OmniOS, arrange to
override ptsname_r.

ChangeLog
lib/ptsname_r.c
m4/ptsname_r.m4

index 0fc47b2d9cd9f6a160e8611afd23837d26237481..e75769075b0f72a9ece4e845a29b1c810edbac9f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2025-01-24  Collin Funk  <collin.funk1@gmail.com>
+
+       ptsname_r: Work around ptsname_r bug on Solaris 11 OmniOS.
+       * lib/ptsname_r.c (ptsname_r): Ensure the resulting buffer is not
+       clobbered if it is too small on Solaris 11 OmniOS.
+       * m4/ptsname_r.m4 (gl_FUNC_PTSNAME_R): On Solaris 11 OmniOS, arrange to
+       override ptsname_r.
+
 2025-01-24  Collin Funk  <collin.funk1@gmail.com>
 
        strerrorname_np: Work around a bug on Solaris 11 OmniOS.
index cc1ae495ec75ef0276b833dd21472c8247887401..3452afb8448186daf338ea749d8f18dea2ccaed4 100644 (file)
@@ -1,5 +1,5 @@
 /* Determine name of the slave side of a pseudo-terminal.
-   Copyright (C) 1998, 2002, 2010-2024 Free Software Foundation, Inc.
+   Copyright (C) 1998, 2002, 2010-2025 Free Software Foundation, Inc.
 
    This file is free software: you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as
@@ -68,7 +68,7 @@ ptsname_r (int fd, char *buf, size_t buflen)
 #undef ptsname_r
 {
 #if HAVE_ESSENTIALLY_WORKING_PTSNAME_R
-# if defined __NetBSD__
+# if defined __NetBSD__ || defined __sun
   char tmpbuf[32];
   if (buf == NULL)
     return EINVAL;
index 286ccab8c9b70fb7a6e093a3ef8692e2a5fbcf2d..00535baecc724faada8d13729a5bad62aa8e8eef 100644 (file)
@@ -1,6 +1,6 @@
 # ptsname_r.m4
-# serial 10
-dnl Copyright (C) 2010-2024 Free Software Foundation, Inc.
+# serial 11
+dnl Copyright (C) 2010-2025 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -78,8 +78,10 @@ main (void)
       dnl result buffer. We don't use an AC_RUN_IFELSE test here, because
       dnl while the bug exists on all platforms, only NetBSD/i386 has the
       dnl files /dev/ptyp[01] on which the bug becomes apparent.
+      dnl
+      dnl On Solaris 11 OmniOS the result buffer is clobbered as well.
       case "$host_os" in
-        netbsd*) REPLACE_PTSNAME_R=1 ;;
+        netbsd* | solaris*) REPLACE_PTSNAME_R=1 ;;
       esac
     fi
   fi