Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 0 additions & 27 deletions boards/native/native_sim/reboot_bottom.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,29 +17,6 @@

static const char module[] = "native_sim_reboot";

static long close_open_fds(void)
{
/* close all open file descriptors except 0-2 */
errno = 0;

long max_fd = sysconf(_SC_OPEN_MAX);

if (max_fd < 0) {
if (errno != 0) {
nsi_print_error_and_exit("%s: %s\n", module, strerror(errno));
} else {
nsi_print_warning("%s: Cannot determine maximum number of file descriptors"
"\n",
module);
}
return max_fd;
}
for (int fd = 3; fd < max_fd; fd++) {
(void)close(fd);
}
return 0;
}

static bool reboot_on_exit;

void native_set_reboot_on_exit(void)
Expand All @@ -60,10 +37,6 @@ void maybe_reboot(void)

nsi_get_cmd_line_args(&argc, &argv);

if (close_open_fds() < 0) {
nsi_exit(1);
}

/* Let's set an environment variable which the native_sim hw_info driver may check */
(void)nsi_host_setenv("NATIVE_SIM_RESET_CAUSE", "SOFTWARE", 1);

Expand Down
1 change: 0 additions & 1 deletion tests/boards/native_sim/reset_hw_info/testcase.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
tests:
boards.native_sim.reset_hw_info:
skip: true
platform_allow:
- native_sim
- native_sim/native/64
Expand Down