]> skyeroc.xyz Git - dgamelaunch/commitdiff
Solaris compatibility.
authorJilles Tjoelker <jilles@stack.nl>
Fri, 16 Jan 2004 16:36:33 +0000 (16:36 +0000)
committerJilles Tjoelker <jilles@stack.nl>
Fri, 16 Jan 2004 16:36:33 +0000 (16:36 +0000)
git-svn-id: svn://katsu.triplehelix.org/dgamelaunch/trunk@123 db0b04b0-f4d1-0310-9a6d-de3e77497b0e

dgamelaunch.c
dgl-create-chroot
ttyplay.c
ttyrec.c

index 520ab12329a0a3dfb33efcea446c9bdf7f61b525..36ce7c450aaa9a08c28f59998c92d7a599166f9a 100644 (file)
@@ -49,7 +49,7 @@
 /* program stuff */
 
 #include <stdlib.h>
-#include <curses.h>
+#include <ncurses.h>
 #include <sys/types.h>
 #include <sys/file.h>           /* for flock() */
 #include <sys/time.h>
@@ -1196,7 +1196,7 @@ writefile (int requirenew)
   fl.l_start = 0;
   fl.l_len = 0;
 
-  fpl = fopen ("/dgl-lock", "r");
+  fpl = fopen ("/dgl-lock", "r+");
   if (!fpl)
     graceful_exit (115);
   if (fcntl (fileno (fpl), F_SETLK, &fl))
index a0d4505b97ae466e2ca20c37e27df32587321928..fb2d30c8f98c0f31759e0f899dacebe7a16c1013 100755 (executable)
@@ -25,7 +25,7 @@ playground_var="/var/games/nethack"
 # termcap/terminfo (copied recursively) (leave blank to skip)
 termdata="/usr/share/terminfo"
 
-[ -f dgl-create-chroot.conf ] && . dgl-create-chroot.conf
+[ -f dgl-create-chroot.conf ] && . ./dgl-create-chroot.conf
 
 findlibs()
 {
@@ -59,7 +59,7 @@ echo "games:*:$shed_uid:$shed_gid:games:/nonexistent:" >$chroot_path/etc/passwd
 echo "games:*:$shed_gid:" >$chroot_path/etc/group
 
 # Time zone information, NetHack uses this
-[ -e /etc/localtime ] && cp /etc/localtime $chroot_path/etc
+[ -f /etc/localtime ] && cp /etc/localtime $chroot_path/etc
 
 # Dungeon directory setup
 mkdir -p $chroot_path/dgldir/inprogress
@@ -120,8 +120,12 @@ fi
 
 # Curses junk
 if [ -n "$termdata" ]; then
-       mkdir -p $chroot_path`dirname $termdata`
-       cp -RL $termdata $chroot_path`dirname $termdata`
+       mkdir -p $chroot_path$termdata
+       if [ -d $termdata/. ]; then
+               cp -R $termdata/. $chroot_path$termdata
+       else
+               cp $termdata $chroot_path`dirname $termdata`
+       fi
 fi
 
 # Necessary libraries
index 36e39d9ba0a377337a1d181cdbe1e5aa3c56fc9d..36d4cae9d2b5ae5133c5420b571d0c73b66db111 100644 (file)
--- a/ttyplay.c
+++ b/ttyplay.c
@@ -40,7 +40,7 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <string.h>
-#include <curses.h>
+#include <ncurses.h>
 #include "ttyrec.h"
 #include "io.h"
 #include "stripgfx.h"
@@ -408,6 +408,8 @@ ttyplay_main (char *ttyfile, int mode, int rstripgfx)
   tcgetattr (0, &old);          /* Get current terminal state */
   new = old;                    /* Make a copy */
   new.c_lflag &= ~(ICANON | ECHO | ECHONL); /* unbuffered, no echo */
+  new.c_cc[VMIN] = 1;
+  new.c_cc[VTIME] = 0;
   tcsetattr (0, TCSANOW, &new); /* Make it current */
 
   process (input, speed, read_func, wait_func);
index 9407c5f2b123ed8f0c32872b6c15f42087fb5977..d7bcb089a702060e506d301bf33ba080f744b6f6 100644 (file)
--- a/ttyrec.c
+++ b/ttyrec.c
@@ -77,8 +77,6 @@
 #include <libutil.h>
 #endif
 
-#define CDEL _POSIX_VDISABLE
-
 extern char ttyrec_filename[100];
 extern int pid_game;
 
@@ -318,12 +316,14 @@ fixtty ()
   rtt.c_iflag = 0;
   rtt.c_lflag &= ~(ISIG | ICANON | XCASE | ECHO | ECHOE | ECHOK | ECHONL);
   rtt.c_oflag = OPOST;
-  rtt.c_cc[VINTR] = CDEL;
-  rtt.c_cc[VQUIT] = CDEL;
-  rtt.c_cc[VERASE] = CDEL;
-  rtt.c_cc[VKILL] = CDEL;
+  rtt.c_cc[VINTR] = _POSIX_VDISABLE;
+  rtt.c_cc[VQUIT] = _POSIX_VDISABLE;
+  rtt.c_cc[VERASE] = _POSIX_VDISABLE;
+  rtt.c_cc[VKILL] = _POSIX_VDISABLE;
   rtt.c_cc[VEOF] = 1;
   rtt.c_cc[VEOL] = 0;
+  rtt.c_cc[VMIN] = 1;
+  rtt.c_cc[VTIME] = 0;
   (void) tcsetattr (0, TCSAFLUSH, &rtt);
 }