Once the process exits successfully, we call this function
12152
function openSerialPortDevice(readFd) {
		//Save TTY streams
		self._readStream = new tty.ReadStream(readFd);
		self._readStream.setRawMode(true);
		self._writeStream = self._readStream;
		//Setup error handlers
		self._readStream.on("error", function(err) {
			self.emit("error", err);
		});
		//Setup read event handlers
		self._readStream.on("data", function(chunk) {
			self.push(chunk);
		});
		self._readStream.on("end", function() {
			self.push(null);
		});
		self._readStream.on("close", function() {
			self.emit("close");
		});
		//Emit open event
		self.emit("open",self._readStream);
	}
404824
function () {
  var args = Array.prototype.slice.call(arguments);
  console.error();
  console.error.apply(console, [" "].concat(args));
  console.error();
  process.exit(1); // eslint-disable-line no-process-exit
}
345069
def _exit_handler(self):
        

        # TODO: consider handling sys.stderr/sys.stdout exceptions related to
        # TODO (cont.): order of interpreter vs. subprocess shutdown signal receipt.
        # TODO (cont.): see https://bugs.python.org/issue11380


        # Make the cleanup file executable if it exists
        if os.path.isfile(self.cleanup_file):
            # Make the cleanup file self destruct.
            with open(self.cleanup_file, "a") as myfile:
                myfile.write("rm " + self.cleanup_file + "\n")
            os.chmod(self.cleanup_file, 0o755)

        # If the pipeline hasn't completed successfully, or already been marked
        # as failed, then mark it as failed now.

        if not self._has_exit_status:
            print("Pipeline status: {}".format(self.status))
            self.fail_pipeline(Exception("Pipeline failure. See details above."))

        if self.tee:
            self.tee.kill()
469056
def finish(self):
    
    if self.proc is None:
      return None
    self.proc.stdin.close()
    for thread in (self._out_thread, self._err_thread):
      thread.join()
    (out, err) = [
        b"".join(chunks) for chunks in (self._out_chunks, self._err_chunks)
    ]
    self.proc.stdout.close()
    self.proc.stderr.close()
    if self.proc.returncode:
      err = "\n".join([" ".join(self.cmd), err.decode("utf8")])
      raise IOError(err)
    del self.proc
    self.proc = None
    return out
832966
function(result, onKill) {
  /** @return {boolean} Whether this command is still running. */
  this.isRunning = function() {
    return result.isPending();
  };

  /**
   * @return {!promise.Promise.<!Result>} A promise for the result of this
   *     command.
   */
  this.result = function() {
    return result;
  };

  /**
   * Sends a signal to the underlying process.
   * @param {string=} opt_signal The signal to send; defaults to
   *     {@code SIGTERM}.
   */
  this.kill = function(opt_signal) {
    onKill(opt_signal || 'SIGTERM');
  };
}
458534
function postProcess( errorCode ) {
	if ( errorCode ) {
		console.error( `running npm for installing missing dependencies ${collected.join( ", " )} exited on error (${errorCode})` );
	} else if ( exec ) {
		const cmd = exec.join( " " );

		if ( !quiet ) {
			console.error( `invoking follow-up command: ${cmd}` );
		}

		const followup = Child.exec( cmd );

		followup.stdout.pipe( process.stdout );
		followup.stderr.pipe( process.stderr );

		followup.on( "exit", code => {
			process.exit( code );
		} );

		return;
	}

	process.exit( errorCode );
}
1152401
def finish(self):
        
        super(InterruptibleMixin, self).finish()
        signal(SIGINT, self.original_handler)
452887
def postloop(self):
        
        cmd.Cmd.postloop(self)  # Clean up command completion
        d1_cli.impl.util.print_info("Exiting...")
512611
function finishProcessing(err) {
      if (err) return cb(err);
      db.eval(hmz, 2, 'processing_domains', 'expiring_domains',
        domain, next);
    }
872926
function cleanup (exitCode) {
  if(_disabled) {
    return q.resolve();
  }

  var defer = q.defer();

  _readRunIdFile().then(function (run) {
    _logMessage('test finished. Your results can be viewed at: ' +
      'http://' + _hostname + ':' + _port + '/#/' + run.project_id + '/' + run.suite_id + '/' + run.run_id + '/rp');
    fs.unlink(RUN_PID_FILE, function (err) {
      if (err) {
        defer.reject(err);
      } else {
        defer.resolve();
      }
    });
  });

  return defer.promise;
}
97387
private function finalise()
    {
        // Send output to email
        $this->emailOutput();

        // Call any callback defined
        if (is_callable($this->after)) {
            call_user_func($this->after, $this->output, $this->returnCode);
        }
    }
641442
function exitOnEpipe()
{
	process.stdout.on('error', function (err) {
		if (err.code == 'EPIPE') {
			process.exit(0);
		}

		throw (err);
	});
}
149468
def function_end(self):
        """"""
        self.newline_label(self.shared.function_name + "_exit", True, True)
        self.move("%14", "%15")
        self.pop("%14")
        self.newline_text("RET", True)
60577
def _on_process_finished(self):
        
        exit_code = self._process.exitCode()
        if self._process.exitStatus() != self._process.NormalExit:
            exit_code = 139
        self._formatter.append_message('\x1b[0m\nProcess finished with exit code %d' % exit_code,
                                       output_format=OutputFormat.CustomFormat)
        self.setReadOnly(True)
        self.process_finished.emit()
32115
function handleExit (canCancel, signal, code) {
	var i = 0,
		sub;

	while ((sub = subs[i++])) {
		if (sub[0].call(sub[1], canCancel, signal, code) === false && canCancel) {
			return;
		}
	}

	if (canCancel) {
		process.exit(code);
	}
}
589856
def _function_handler(function, args, kwargs, pipe):
    """"""
    signal.signal(signal.SIGINT, signal.SIG_IGN)

    result = process_execute(function, *args, **kwargs)

    send_result(pipe, result)
1171363
def exit_after(s):
    

    def outer(fn):
        def inner(*args, **kwargs):
            timer = threading.Timer(s, thread.interrupt_main)
            timer.start()
            try:
                result = fn(*args, **kwargs)
            except KeyboardInterrupt:
                raise TimeoutError("Function '{}' hit the timeout ({}s).".format(fn.__name__, s))
            finally:
                timer.cancel()
            return result

        return inner

    return outer