Check that we actually do write the inprogress-lock.
git-svn-id: svn://katsu.triplehelix.org/dgamelaunch/trunk@560 db0b04b0-f4d1-0310-9a6d-de3e77497b0e
This commit is contained in:
parent
cb963b5da8
commit
6cb4d79c94
|
@ -205,12 +205,14 @@ gen_inprogress_lock (int game, pid_t pid, char* ttyrec_filename)
|
||||||
{
|
{
|
||||||
char *lockfile = NULL, filebuf[80];
|
char *lockfile = NULL, filebuf[80];
|
||||||
int fd;
|
int fd;
|
||||||
size_t len;
|
size_t len, wrlen;
|
||||||
struct flock fl = { 0 };
|
struct flock fl = { 0 };
|
||||||
|
|
||||||
snprintf (filebuf, sizeof(filebuf), "%d\n%d\n%d\n",
|
snprintf (filebuf, sizeof(filebuf), "%d\n%d\n%d\n",
|
||||||
pid, win.ws_row, win.ws_col);
|
pid, win.ws_row, win.ws_col);
|
||||||
|
|
||||||
|
wrlen = strlen(filebuf);
|
||||||
|
|
||||||
fl.l_type = F_WRLCK;
|
fl.l_type = F_WRLCK;
|
||||||
fl.l_whence = SEEK_SET;
|
fl.l_whence = SEEK_SET;
|
||||||
fl.l_start = 0;
|
fl.l_start = 0;
|
||||||
|
@ -228,7 +230,10 @@ gen_inprogress_lock (int game, pid_t pid, char* ttyrec_filename)
|
||||||
graceful_exit (68);
|
graceful_exit (68);
|
||||||
}
|
}
|
||||||
|
|
||||||
write (fd, filebuf, strlen (filebuf));
|
if (write (fd, filebuf, wrlen) != wrlen) {
|
||||||
|
debug_write("inprogress-lock write");
|
||||||
|
graceful_exit(70);
|
||||||
|
}
|
||||||
|
|
||||||
return lockfile;
|
return lockfile;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue