summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormillert <millert@openbsd.org>2013-12-17 22:12:07 +0000
committermillert <millert@openbsd.org>2013-12-17 22:12:07 +0000
commita182690df08dfa967f70e0b2c577e439808c5ee1 (patch)
tree66ba8e30a46a62c29e9379b5279f67e0c0636584
parentXr mount_tmpfs, trivial ok deraadt@ (diff)
downloadwireguard-openbsd-a182690df08dfa967f70e0b2c577e439808c5ee1.tar.xz
wireguard-openbsd-a182690df08dfa967f70e0b2c577e439808c5ee1.zip
The termios.h bits were missing from the initial commit.
-rw-r--r--lib/libc/termios/tcgetsid.c7
-rw-r--r--sys/sys/termios.h14
2 files changed, 16 insertions, 5 deletions
diff --git a/lib/libc/termios/tcgetsid.c b/lib/libc/termios/tcgetsid.c
index a13b8748d8e..531179212ef 100644
--- a/lib/libc/termios/tcgetsid.c
+++ b/lib/libc/termios/tcgetsid.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tcgetsid.c,v 1.2 2013/12/17 17:55:59 naddy Exp $ */
+/* $OpenBSD: tcgetsid.c,v 1.3 2013/12/17 22:12:07 millert Exp $ */
/*-
* Copyright (c) 1989, 1993
* The Regents of the University of California. All rights reserved.
@@ -29,7 +29,6 @@
*/
#include <sys/ioctl.h>
-#include <sys/types.h>
#include <termios.h>
pid_t
@@ -38,7 +37,7 @@ tcgetsid(int fd)
int s;
if (ioctl(fd, TIOCGSID, &s) < 0)
- return ((pid_t)-1);
+ return (-1);
- return ((pid_t)s);
+ return (s);
}
diff --git a/sys/sys/termios.h b/sys/sys/termios.h
index 81508666d88..bf0ce23a279 100644
--- a/sys/sys/termios.h
+++ b/sys/sys/termios.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: termios.h,v 1.11 2009/12/26 09:46:17 jmc Exp $ */
+/* $OpenBSD: termios.h,v 1.12 2013/12/17 22:12:07 millert Exp $ */
/* $NetBSD: termios.h,v 1.14 1996/04/09 20:55:41 cgd Exp $ */
/*
@@ -248,6 +248,14 @@ struct termios {
#define TCION 4
#include <sys/cdefs.h>
+#include <sys/_types.h>
+
+#if __XPG_VISIBLE >= 420 || __POSIX_VISIBLE >= 200809
+#ifndef _PID_T_DEFINED_
+#define _PID_T_DEFINED_
+typedef __pid_t pid_t;
+#endif
+#endif
__BEGIN_DECLS
speed_t cfgetispeed(const struct termios *);
@@ -261,6 +269,10 @@ int tcflow(int, int);
int tcflush(int, int);
int tcsendbreak(int, int);
+#if __XPG_VISIBLE >= 420 || __POSIX_VISIBLE >= 200809
+pid_t tcgetsid(int);
+#endif
+
#if __BSD_VISIBLE
void cfmakeraw(struct termios *);
int cfsetspeed(struct termios *, speed_t);