Add calls to close for all test programs that leak file descriptors
in order to prevent test failures when run under valgrind
--track-fds=yes.
Signed-off-by: Aaron Merey <amerey@redhat.com>
16 files changed:
#include <stdlib.h>
#include <assert.h>
#include <inttypes.h>
+#include <unistd.h>
static void
ranges_die (Dwarf_Die *die)
walk_tree (&die);
}
dwarf_end (dbg);
+ close (fd);
return 0;
}
return 1;
}
+ close (fd);
return 0;
}
#include <stdlib.h>
#include <assert.h>
#include <inttypes.h>
+#include <unistd.h>
static void include (Dwarf *dbg, Dwarf_Off macoff, ptrdiff_t token);
}
dwarf_end (dbg);
-
+ close (fd);
return 0;
}
#include <stdlib.h>
#include <assert.h>
#include <inttypes.h>
+#include <unistd.h>
int
main (int argc, char *argv[])
start, end, base);
dwarf_end (dbg);
-
+ close (fd);
return 0;
}
dwarf_end (dwarf);
elf_end (elf);
+ close (fd);
return result;
}
#include <assert.h>
#include ELFUTILS_HEADER(dwfl)
#include ELFUTILS_HEADER(elf)
+#include <unistd.h>
static const Dwfl_Callbacks cb =
{
dwfl_end (dwfl);
elf_end (elf);
+ close (fd);
return 0;
}
error (3, 0, "gelf_offscn: %s", elf_errmsg (-1));
elf_end (elf);
+ close (fd);
return 0;
}
close (outfd);
elf_end (inelf);
+ close (infd);
return 0;
}
(void) elf_end (elf);
}
+ close (fd);
return result;
}
#include <stdio.h>
#include <string.h>
#include <assert.h>
+#include <unistd.h>
int
main (int argc, char **argv)
assert (dwarf_tag (die) == 0);
dwarf_end (dw);
+ close (i);
return 0;
}
}
elf_end (elf);
+
+ if (!close_fd)
+ close (fd);
+
exit (0);
}
#include <fcntl.h>
#include <stdlib.h>
#include <gelf.h>
+#include <unistd.h>
int
main (int argc, char **argv)
elf_flagdata (elf_getdata (scn, NULL), ELF_C_SET, ELF_F_DIRTY);
elf_end (stripped);
+ close (fd);
return 0;
}
}
unlink (fname);
+ close (fd);
return 0;
}
}
unlink (fname);
+ close (fd);
return 0;
}
}
unlink (fname);
+ close (fd);
return 0;
}
}
unlink (fname);
+ close (fd);
return 0;
}