001-init_avoid_loop_opening_tty.patch 887 B

1234567891011121314151617181920
  1. --- a/init/init.c
  2. +++ b/init/init.c
  3. @@ -505,12 +505,11 @@
  4. for (a = init_action_list; a; a = tmp) {
  5. tmp = a->next;
  6. if (a->action_type & action_type) {
  7. - // Pointless: run() will error out if open of device fails.
  8. - ///* a->terminal of "" means "init's console" */
  9. - //if (a->terminal[0] && access(a->terminal, R_OK | W_OK)) {
  10. - // //message(L_LOG | L_CONSOLE, "Device %s cannot be opened in RW mode", a->terminal /*, strerror(errno)*/);
  11. - // delete_init_action(a);
  12. - //} else
  13. + /* a->terminal of "" means "init's console" */
  14. + if (a->terminal[0] && access(a->terminal, R_OK | W_OK)) {
  15. + //message(L_LOG | L_CONSOLE, "Device %s cannot be opened in RW mode", a->terminal /*, strerror(errno)*/);
  16. + delete_init_action(a);
  17. + } else
  18. if (a->action_type & (SYSINIT | WAIT | CTRLALTDEL | SHUTDOWN | RESTART)) {
  19. waitfor(run(a));
  20. delete_init_action(a);