mirror of
https://github.com/paxed/dgamelaunch.git
synced 2025-07-31 01:24:43 +02:00
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:
parent
c0afaba270
commit
09b7c71f72
8
ttyrec.c
8
ttyrec.c
@ -89,6 +89,7 @@ ttyrec_main (char *username, char* ttyrec_filename)
|
|||||||
snprintf (dirname, 100, "%sttyrec/%s/%s", myconfig->dglroot, username,
|
snprintf (dirname, 100, "%sttyrec/%s/%s", myconfig->dglroot, username,
|
||||||
ttyrec_filename);
|
ttyrec_filename);
|
||||||
|
|
||||||
|
atexit(&remove_ipfile);
|
||||||
if ((fscript = fopen (dirname, "w")) == NULL)
|
if ((fscript = fopen (dirname, "w")) == NULL)
|
||||||
{
|
{
|
||||||
perror (dirname);
|
perror (dirname);
|
||||||
@ -369,3 +370,10 @@ getslave ()
|
|||||||
#endif /* !NOSTREAMS */
|
#endif /* !NOSTREAMS */
|
||||||
(void) ioctl (0, TIOCGWINSZ, (char *) &win);
|
(void) ioctl (0, TIOCGWINSZ, (char *) &win);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
remove_ipfile (void)
|
||||||
|
{
|
||||||
|
if (ipfile != NULL)
|
||||||
|
unlink (ipfile);
|
||||||
|
}
|
||||||
|
1
ttyrec.h
1
ttyrec.h
@ -19,6 +19,7 @@ extern void doinput (void);
|
|||||||
extern void dooutput (void);
|
extern void dooutput (void);
|
||||||
extern void doshell (char *);
|
extern void doshell (char *);
|
||||||
extern void finish (int);
|
extern void finish (int);
|
||||||
|
extern void remove_ipfile (void);
|
||||||
|
|
||||||
extern int ttyrec_main(char *username, char *ttyrec_filename);
|
extern int ttyrec_main(char *username, char *ttyrec_filename);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user