Fixed fdtab_copy
@@ -96,8 +96,10 @@ fdtab_t *fdtab_copy(fdtab_t *fdt) {
file_t *f = fdt->fdt_files[i];
/* TODO: Deep or shallow copy? */
newfdt->fdt_files[i] = f;
+ if (f)
file_ref(f);
}
+ memcpy(newfdt->fdt_map, fdt->fdt_map, sizeof(bitstr_t) * bitstr_size(NDFILE));
mtx_unlock(&fdt->fdt_mtx);
