Ticket #45309: gspawn.c-print-sleep.diff

File gspawn.c-print-sleep.diff, 1.2 KB (added by ewen-naos-nz (Ewen McNeill), 8 years ago)

glib/gspawn.c(): fork_exec_with_pipes() debug print patch

  • (a) /Users/ewen/Desktop/gspawn.c-orig-2014-11-02 vs. (b) gspawn.c

    a b  
    13341334  if (standard_error && !g_unix_open_pipe (stderr_pipe, FD_CLOEXEC, error))
    13351335    goto cleanup_and_fail;
    13361336
     1337  /* XXX: Debugging prints */
     1338  fprintf (stderr, "About to fork in fork_exec_with_pipes()\n");
    13371339  pid = fork ();
     1340  fprintf (stderr, "Immediately after fork in fork_exec_with_pipes(), pid=%ld\n", (long)pid);
    13381341
    13391342  if (pid < 0)
    13401343    {
     
    13531356      /* Immediate child. This may or may not be the child that
    13541357       * actually execs the new process.
    13551358       */
     1359      /* XXX: Fork debugging assistance */
     1360      fprintf (stderr, "Child PID started as %ld\n", (long)getpid());
     1361      sleep(5);
    13561362
    13571363      /* Reset some signal handlers that we may use */
    13581364      signal (SIGCHLD, SIG_DFL);
     
    14271433        {
    14281434          /* Just run the child.
    14291435           */
     1436          /* XXX: Fork debugging assistance */
     1437          fprintf (stderr, "Child PID %ld calling do_exec()\n", (long)getpid());
     1438          sleep(5);
    14301439
    14311440          do_exec (child_err_report_pipe[1],
    14321441                   stdin_pipe[0],