MCPcopy Create free account
hub / github.com/git/git / child_err_spew

Function child_err_spew

run-command.c:378–408  ·  view source on GitHub ↗

this runs in the parent process */

Source from the content-addressed store, hash-verified

376
377/* this runs in the parent process */
378static void child_err_spew(struct child_process *cmd, struct child_err *cerr)
379{
380 static void (*old_errfn)(const char *err, va_list params);
381 report_fn die_message_routine = get_die_message_routine();
382
383 old_errfn = get_error_routine();
384 set_error_routine(die_message_routine);
385 errno = cerr->syserr;
386
387 switch (cerr->err) {
388 case CHILD_ERR_CHDIR:
389 error_errno("exec '%s': cd to '%s' failed",
390 cmd->args.v[0], cmd->dir);
391 break;
392 case CHILD_ERR_DUP2:
393 error_errno("dup2() in child failed");
394 break;
395 case CHILD_ERR_CLOSE:
396 error_errno("close() in child failed");
397 break;
398 case CHILD_ERR_SIGPROCMASK:
399 error_errno("sigprocmask failed restoring signals");
400 break;
401 case CHILD_ERR_SILENT:
402 break;
403 case CHILD_ERR_ERRNO:
404 error_errno("cannot exec '%s'", cmd->args.v[0]);
405 break;
406 }
407 set_error_routine(old_errfn);
408}
409
410static int prepare_cmd(struct strvec *out, const struct child_process *cmd)
411{

Callers 1

start_commandFunction · 0.85

Calls 4

get_die_message_routineFunction · 0.85
get_error_routineFunction · 0.85
set_error_routineFunction · 0.85
error_errnoFunction · 0.85

Tested by

no test coverage detected