Commit 65c6d429 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Fix a race exposed on fast 32 bit FreeBSD

parent ea6b5ec5
......@@ -916,7 +916,7 @@ void
cmd_process(CMD_ARGS)
{
struct process *p, *p2;
uintmax_t u, v;
uintmax_t u, v, bsnap;
unsigned lin,col;
int spec_set = 0;
......@@ -952,6 +952,8 @@ cmd_process(CMD_ARGS)
p = process_new(av[0]);
av++;
bsnap = p->stdout_bytes;
for (; *av != NULL; av++) {
if (vtc_error)
break;
......@@ -1003,7 +1005,7 @@ cmd_process(CMD_ARGS)
if (!strcmp(*av, "-need-bytes")) {
u = strtoumax(av[1], NULL, 0);
if (av[1][0] == '+')
u += p->stdout_bytes;
u += bsnap;
av++;
do {
AZ(pthread_mutex_lock(&p->mtx));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment