/* 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>
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))
# 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()
{
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
# 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
#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"
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);
#include <libutil.h>
#endif
-#define CDEL _POSIX_VDISABLE
-
extern char ttyrec_filename[100];
extern int pid_game;
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);
}