+ case MSG_ERROR_EXIT:
+ if (msg_bytes == 0) {
+ if (!am_sender && !am_generator) {
+ send_msg(MSG_ERROR_EXIT, "", 0, 0);
+ io_flush(FULL_FLUSH);
+ }
+ val = 0;
+ } else if (msg_bytes == 4) {
+ data = perform_io(4, PIO_INPUT_AND_CONSUME);
+ val = IVAL(data, 0);
+ if (protocol_version >= 31) {
+ if (am_generator)
+ send_msg_int(MSG_ERROR_EXIT, val);
+ else
+ send_msg(MSG_ERROR_EXIT, "", 0, 0);
+ }
+ } else
+ goto invalid_msg;
+ /* Send a negative linenum so that we don't end up
+ * with a duplicate exit message. */
+ _exit_cleanup(val, __FILE__, 0 - __LINE__);