diff options
author | 2017-09-10 18:20:00 +0000 | |
---|---|---|
committer | 2017-09-10 18:20:00 +0000 | |
commit | 81064d433281cbb881394cc726b6ecbb9268d4ee (patch) | |
tree | bc0dbc3e8baf2fddc8cfad4fc471e1cb0a8b517e /lib/libc/termios | |
parent | Backslash escapes the next character in filename patterns. (diff) | |
download | wireguard-openbsd-81064d433281cbb881394cc726b6ecbb9268d4ee.tar.xz wireguard-openbsd-81064d433281cbb881394cc726b6ecbb9268d4ee.zip |
shm_open(), sysconf(), tcflow(), and tcsendbreak() are not permitted to be
cancellation points in POSIX, so change them to invoke the non-cancellation
point versions of open(), close(), nanosleep(), and write()
ok deraadt@ millert@
Diffstat (limited to 'lib/libc/termios')
-rw-r--r-- | lib/libc/termios/tcflow.c | 5 | ||||
-rw-r--r-- | lib/libc/termios/tcsendbreak.c | 4 |
2 files changed, 5 insertions, 4 deletions
diff --git a/lib/libc/termios/tcflow.c b/lib/libc/termios/tcflow.c index 458999da488..0f1659691c9 100644 --- a/lib/libc/termios/tcflow.c +++ b/lib/libc/termios/tcflow.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tcflow.c,v 1.5 2005/08/05 13:03:00 espie Exp $ */ +/* $OpenBSD: tcflow.c,v 1.6 2017/09/10 18:20:00 guenther Exp $ */ /*- * Copyright (c) 1989, 1993 * The Regents of the University of California. All rights reserved. @@ -49,7 +49,8 @@ tcflow(int fd, int action) if (tcgetattr(fd, &term) == -1) return (-1); c = term.c_cc[action == TCIOFF ? VSTOP : VSTART]; - if (c != _POSIX_VDISABLE && write(fd, &c, sizeof(c)) == -1) + if (c != _POSIX_VDISABLE && + HIDDEN(write)(fd, &c, sizeof(c)) == -1) return (-1); return (0); default: diff --git a/lib/libc/termios/tcsendbreak.c b/lib/libc/termios/tcsendbreak.c index f35838509f3..5419d7c41bf 100644 --- a/lib/libc/termios/tcsendbreak.c +++ b/lib/libc/termios/tcsendbreak.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tcsendbreak.c,v 1.9 2015/11/01 03:45:29 guenther Exp $ */ +/* $OpenBSD: tcsendbreak.c,v 1.10 2017/09/10 18:20:00 guenther Exp $ */ /*- * Copyright (c) 1989, 1993 * The Regents of the University of California. All rights reserved. @@ -42,7 +42,7 @@ tcsendbreak(int fd, int len) if (ioctl(fd, TIOCSBRK, 0) == -1) return (-1); - (void)nanosleep(&sleepytime, NULL); + HIDDEN(nanosleep)(&sleepytime, NULL); if (ioctl(fd, TIOCCBRK, 0) == -1) return (-1); return (0); |