diff --git a/dgamelaunch.c b/dgamelaunch.c index 520ab12..36ce7c4 100644 --- a/dgamelaunch.c +++ b/dgamelaunch.c @@ -49,7 +49,7 @@ /* program stuff */ #include -#include +#include #include #include /* for flock() */ #include @@ -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)) diff --git a/dgl-create-chroot b/dgl-create-chroot index a0d4505..fb2d30c 100755 --- a/dgl-create-chroot +++ b/dgl-create-chroot @@ -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 diff --git a/ttyplay.c b/ttyplay.c index 36e39d9..36d4cae 100644 --- a/ttyplay.c +++ b/ttyplay.c @@ -40,7 +40,7 @@ #include #include #include -#include +#include #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); diff --git a/ttyrec.c b/ttyrec.c index 9407c5f..d7bcb08 100644 --- a/ttyrec.c +++ b/ttyrec.c @@ -77,8 +77,6 @@ #include #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); }