nspawn: move the main loop body out to a new function

The new function has 416 lines by itself!

"return log_error_errno" is used to nicely reduce the volume of error
handling code.

A few minor issues are fixed on the way:
- positive value was used as error value (EIO), causing systemd-nspawn
  to return success, even though it shouldn't.
- In two places random values were used as error status, when the
  actual value was in an unusual place (etc_password_lock, notify_socket).

Those are the only functional changes.

There is another potential issue, which is marked with a comment, and left
unresolved: the container can also return 133 by itself, causing a spurious
reboot.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2016-10-02 21:32:38 +02:00
parent 98afd6af3a
commit b006762524

File diff suppressed because it is too large Load Diff