return 0;
}
+/*
+ libdw does not seem to export the error codes in their header files,
+ although there is a function to retrieve them...
+*/
+#ifndef DWARF_E_NO_DWARF
+#define DWARF_E_NO_DWARF 6
+#endif
+
static int pakfire_stripper_copy_sources(
struct pakfire_ctx* ctx, struct pakfire_file* file, void* data) {
struct pakfire_stripper* stripper = data;
// Read DWARF information
dwarf = dwarf_begin(fileno(f), DWARF_C_READ);
if (!dwarf) {
- CTX_ERROR(ctx, "Could not initialize DWARF context: %s\n", dwarf_errmsg(-1));
- r = -errno;
- goto ERROR;
+ switch (dwarf_errno()) {
+ // If we don't have any DWARF information there is nothing to do
+ case DWARF_E_NO_DWARF:
+ r = 0;
+ goto ERROR;
+
+ default:
+ CTX_ERROR(ctx, "Could not initialize DWARF context: %s\n", dwarf_errmsg(-1));
+ r = -errno;
+ goto ERROR;
+ }
}
for (;;) {