cifs: fix rfork() race with shard pid variable

This commit is contained in:
cinap_lenrek 2024-01-05 07:07:53 +00:00
parent ee2174eb6d
commit e80c7eb50b

View file

@ -1325,10 +1325,11 @@ connected:
if(Nshares == 0)
fprint(2, "no available shares\n");
if((Keeppid = rfork(RFPROC|RFMEM|RFNOTEG|RFFDG|RFNAMEG)) == 0){
if((i = rfork(RFPROC|RFMEM|RFNOTEG|RFFDG|RFNAMEG)) == 0){
keepalive();
exits(nil);
}
Keeppid = i;
postmountsrv(&fs, svs, mtpt, MREPL|MCREATE);
exits(nil);
}