attempt to remove the inprogress file on an unclean termination

git-svn-id: svn://katsu.triplehelix.org/dgamelaunch/trunk@222 db0b04b0-f4d1-0310-9a6d-de3e77497b0e
This commit is contained in:
Joshua Kwan 2004-02-03 03:02:19 +00:00
parent c0afaba270
commit 09b7c71f72
2 changed files with 9 additions and 0 deletions

View File

@ -89,6 +89,7 @@ ttyrec_main (char *username, char* ttyrec_filename)
snprintf (dirname, 100, "%sttyrec/%s/%s", myconfig->dglroot, username,
ttyrec_filename);
atexit(&remove_ipfile);
if ((fscript = fopen (dirname, "w")) == NULL)
{
perror (dirname);
@ -369,3 +370,10 @@ getslave ()
#endif /* !NOSTREAMS */
(void) ioctl (0, TIOCGWINSZ, (char *) &win);
}
void
remove_ipfile (void)
{
if (ipfile != NULL)
unlink (ipfile);
}

View File

@ -19,6 +19,7 @@ extern void doinput (void);
extern void dooutput (void);
extern void doshell (char *);
extern void finish (int);
extern void remove_ipfile (void);
extern int ttyrec_main(char *username, char *ttyrec_filename);