Solaris compatibility.
git-svn-id: svn://katsu.triplehelix.org/dgamelaunch/trunk@123 db0b04b0-f4d1-0310-9a6d-de3e77497b0e
This commit is contained in:
parent
cc4181039e
commit
1a081cc170
|
@ -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))
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
|
|
12
ttyrec.c
12
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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue