File tree Expand file tree Collapse file tree 1 file changed +0
-27
lines changed Expand file tree Collapse file tree 1 file changed +0
-27
lines changed Original file line number Diff line number Diff line change 17
17
18
18
static const char module [] = "native_sim_reboot" ;
19
19
20
- static long close_open_fds (void )
21
- {
22
- /* close all open file descriptors except 0-2 */
23
- errno = 0 ;
24
-
25
- long max_fd = sysconf (_SC_OPEN_MAX );
26
-
27
- if (max_fd < 0 ) {
28
- if (errno != 0 ) {
29
- nsi_print_error_and_exit ("%s: %s\n" , module , strerror (errno ));
30
- } else {
31
- nsi_print_warning ("%s: Cannot determine maximum number of file descriptors"
32
- "\n" ,
33
- module );
34
- }
35
- return max_fd ;
36
- }
37
- for (int fd = 3 ; fd < max_fd ; fd ++ ) {
38
- (void )close (fd );
39
- }
40
- return 0 ;
41
- }
42
-
43
20
static bool reboot_on_exit ;
44
21
45
22
void native_set_reboot_on_exit (void )
@@ -60,10 +37,6 @@ void maybe_reboot(void)
60
37
61
38
nsi_get_cmd_line_args (& argc , & argv );
62
39
63
- if (close_open_fds () < 0 ) {
64
- nsi_exit (1 );
65
- }
66
-
67
40
/* Let's set an environment variable which the native_sim hw_info driver may check */
68
41
(void )nsi_host_setenv ("NATIVE_SIM_RESET_CAUSE" , "SOFTWARE" , 1 );
69
42
You can’t perform that action at this time.
0 commit comments