git-tiocflush
authorGNU Libc Maintainers <debian-glibc@lists.debian.org>
Sat, 2 Oct 2021 12:47:40 +0000 (13:47 +0100)
committerAurelien Jarno <aurel32@debian.org>
Sat, 2 Oct 2021 12:47:40 +0000 (13:47 +0100)
Committed for 2.34

commit 36231bee7ab36d59dd121ea85b91411ae86945f3
Author: Samuel Thibault <samuel.thibault@ens-lyon.org>
Date:   Mon Feb 1 19:39:48 2021 +0100

    hurd TIOCFLUSH: Cope BSD 4.1 semantic

    BSD 4.1 did not have an argument for TIOCFLUSH, BSD 4.2 added it. There
    are still a lot of applications out there that pass a NULL argument to
    TIOCFLUSH, so we should rather cope with it.

Gbp-Pq: Topic hurd-i386
Gbp-Pq: Name git-tiocflush.diff

sysdeps/mach/hurd/ioctl.c

index a9a148f1e31a4a066b367c5e5d7d3a980af5c2ce..5a30a71d3225f742f37ecd4c978653cc6c41c2c9 100644 (file)
@@ -112,6 +112,10 @@ __ioctl (int fd, unsigned long int request, ...)
          /* We don't want to advance ARG since it will be used to copy out
             too if IOC_OUT is also set.  */
          void *argptr = arg;
+         int zero = 0;
+
+         if (request == TIOCFLUSH && !argptr)
+           argptr = &zero;
 
          /* Pack an argument into the message buffer.  */
          void in (unsigned int count, enum __ioctl_datum type)