main.c (d3878bb8003009d148cd787e1a2d74cff914a7b2) main.c (0936d4f3d5a3d5daf453bc341f02ba4e68cfe40e)
1/*
2 * Copyright (C) 2015 Thomas Meyer (thomas@m3y3r.de)
3 * Copyright (C) 2000 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com)
4 * Licensed under the GPL
5 */
6
7#include <stdio.h>
8#include <stdlib.h>

--- 60 unchanged lines hidden (view full) ---

69 * handler reset to the default behavior, so that if an exit
70 * handler is hanging for some reason, the UML will just die
71 * after this signal is sent a second time.
72 */
73 action.sa_flags = SA_RESETHAND | SA_NODEFER;
74 action.sa_restorer = NULL;
75 action.sa_handler = last_ditch_exit;
76 if (sigaction(sig, &action, NULL) < 0) {
1/*
2 * Copyright (C) 2015 Thomas Meyer (thomas@m3y3r.de)
3 * Copyright (C) 2000 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com)
4 * Licensed under the GPL
5 */
6
7#include <stdio.h>
8#include <stdlib.h>

--- 60 unchanged lines hidden (view full) ---

69 * handler reset to the default behavior, so that if an exit
70 * handler is hanging for some reason, the UML will just die
71 * after this signal is sent a second time.
72 */
73 action.sa_flags = SA_RESETHAND | SA_NODEFER;
74 action.sa_restorer = NULL;
75 action.sa_handler = last_ditch_exit;
76 if (sigaction(sig, &action, NULL) < 0) {
77 printf("failed to install handler for signal %d - errno = %d\n",
78 sig, errno);
77 os_warn("failed to install handler for signal %d "
78 "- errno = %d\n", sig, errno);
79 exit(1);
80 }
81}
82
83#define UML_LIB_PATH ":" OS_LIB_PATH "/uml"
84
85static void setup_env_path(void)
86{

--- 83 unchanged lines hidden (view full) ---

170 */
171
172 /* stop timers and set timer signal to be ignored */
173 os_timer_disable();
174
175 /* disable SIGIO for the fds and set SIGIO to be ignored */
176 err = deactivate_all_fds();
177 if (err)
79 exit(1);
80 }
81}
82
83#define UML_LIB_PATH ":" OS_LIB_PATH "/uml"
84
85static void setup_env_path(void)
86{

--- 83 unchanged lines hidden (view full) ---

170 */
171
172 /* stop timers and set timer signal to be ignored */
173 os_timer_disable();
174
175 /* disable SIGIO for the fds and set SIGIO to be ignored */
176 err = deactivate_all_fds();
177 if (err)
178 printf("deactivate_all_fds failed, errno = %d\n", -err);
178 os_warn("deactivate_all_fds failed, errno = %d\n", -err);
179
180 /*
181 * Let any pending signals fire now. This ensures
182 * that they won't be delivered after the exec, when
183 * they are definitely not expected.
184 */
185 unblock_signals();
186

--- 80 unchanged lines hidden ---
179
180 /*
181 * Let any pending signals fire now. This ensures
182 * that they won't be delivered after the exec, when
183 * they are definitely not expected.
184 */
185 unblock_signals();
186

--- 80 unchanged lines hidden ---