Remove extra loop counter data dependancy in `map_haystacks()` error rollback path.

Fortune for naka's current commit: Small curse − 小凶
master
Avril 3 years ago
parent b0623182be
commit 77c57d3624
Signed by: flanchan
GPG Key ID: 284488987C31F630

@ -59,8 +59,8 @@ static int map_haystacks(const char* const * h, map_t maps[pOUT])
// Prep reset maps to before `c` for unwind
maps-=1;
ERROR("Failed to map file `%s', rolling back %lu maps. (erp: %p, prev: %p)", path, d, c, maps);
for(usize i=0;i<d;i++)
if(!map_handle_err(map_free(* (--maps)))) WARN("Failed to free map at %p (in %lu unwind)", maps, i);
while( d --> 0 )
if(!map_handle_err(map_free(* (--maps)))) WARN("Failed to free map at %p (in %lu unwind)", maps, d);
return 0;
}
d+=1;

Loading…
Cancel
Save