$NetBSD: patch-ac,v 1.6 2005/09/27 14:44:18 tonio Exp $

--- pty.c.orig	2005-08-12 02:26:59.000000000 +0200
+++ pty.c
@@ -15,7 +15,7 @@ extern void uerror (char * cmdname, valu
 #define HAS_OPENPTY 1
 #endif
 
-#ifdef __APPLE__
+#if defined(__APPLE__) || defined(__NetBSD__)
 #include <util.h>
 #define HAS_OPENPTY 1
 #endif
@@ -40,9 +40,10 @@ CAMLprim value setControllingTerminal(va
 /* c_openpty: unit -> (int * Unix.file_descr) */
 CAMLprim value c_openpty() {
   int master,slave;
+  value pair;
   if (openpty(&master,&slave,NULL,NULL,NULL) < 0)
     uerror("openpty", (value) 0);
-  value pair = alloc_tuple(2);
+  pair = alloc_tuple(2);
   Store_field(pair,0,Val_int(master));
   Store_field(pair,1,Val_int(slave));
   return pair;
