--- ethereal.c.orig	Tue Dec 29 05:08:17 1998
+++ ethereal.c	Wed Jan 20 01:10:24 1999
@@ -163,8 +163,21 @@
     /* reload so it goes in effect. Also we set data_out_file which 
        tells the tcp code to output the data */
     close_cap_file( &cf, info_bar, file_ctx);
+#if defined(__OpenBSD__)
+    {
+      int tmp_fd;
+
+      snprintf( "%sXXXXXXXXXX", sizeof filename1, P_tmpdir );
+      tmp_fd = mkstemp( filename1 );
+      if ( tmp_fd == -1 ) {
+	err( 1, "can't create temp file %s", filename1 );
+      }
+      data_out_file = fdopen( tmp_fd, "a" );
+    }
+#else
     strcpy( filename1, tmpnam(NULL) );
     data_out_file = fopen( filename1, "a" );
+#endif
     if( data_out_file == NULL ) {
       fprintf( stderr, "Could not open tmp file %s\n", filename1 );
     }
