aboutsummaryrefslogtreecommitdiff
path: root/compat/forkpty-sunos.c
diff options
context:
space:
mode:
Diffstat (limited to 'compat/forkpty-sunos.c')
-rw-r--r--compat/forkpty-sunos.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/compat/forkpty-sunos.c b/compat/forkpty-sunos.c
index bc4fe8a3..a4b1dbdf 100644
--- a/compat/forkpty-sunos.c
+++ b/compat/forkpty-sunos.c
@@ -1,7 +1,7 @@
-/* $Id: forkpty-sunos.c,v 1.5 2008-06-18 22:21:51 nicm Exp $ */
+/* $Id: forkpty-sunos.c,v 1.6 2008-06-23 21:54:48 nicm Exp $ */
/*
- * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
+ * Copyright (c) 2008 Nicholas Marriott <nicm@users.sourceforge.net>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
@@ -17,6 +17,7 @@
*/
#include <sys/types.h>
+#include <sys/ioctl.h>
#include <fcntl.h>
#include <stdlib.h>
@@ -52,8 +53,10 @@ forkpty(int *master,
close(*master);
setsid();
+#ifdef TIOCSCTTY
if (ioctl(slave, TIOCSCTTY, NULL) == -1)
fatal("ioctl failed");
+#endif
if (ioctl(slave, I_PUSH, "ptem") == -1)
fatal("ioctl failed");