Codebase list kmod / 53b30ae
depmod: do not output .bin to stdout index_write() relies on fseek/ftell to manage the position to which we are write and thus needs the file stream to support it. Right now when trying to write the index to stdout we fail with: depmod: tools/depmod.c:416: index_write: Assertion `initial_offset >= 0' failed. Aborted (core dumped) We have no interest in outputting our index to stdout, so just skip it like is done with other indexes. While at it, add/remove some newlines to improve readability. Reported-by: Yanko Kaneti <yaneti@declera.com> Fix: b866b2165ae6 ("Lookup aliases in the modules.builtin.modinfo") Lucas De Marchi 4 years ago
1 changed file(s) with 5 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
24072407 struct index_node *idx;
24082408 struct kmod_list *l, *builtin = NULL;
24092409
2410 if (out == stdout)
2411 return 0;
2412
24102413 idx = index_create();
2411
24122414 if (idx == NULL) {
24132415 ret = -ENOMEM;
24142416 goto fail;
24552457
24562458 if (count)
24572459 index_write(idx, out);
2460
24582461 index_destroy(idx);
2462
24592463 fail:
24602464 if (builtin)
24612465 kmod_module_unref_list(builtin);