https://bugzilla.novell.com/show_bug.cgi?id=389500


           Summary: Exit code of forked process is mangled
           Product: Mono: Runtime
           Version: SVN
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: io-layer
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]
         QAContact: [email protected]
          Found By: ---


On Linux, the exit code of a forked process is not correctly returned by
Process.ExitCode.

To reproduce, compile and run the following code (using mcs test.cs):

using System;
using System.Diagnostics;
using System.IO;

class Program
{
  static int Main (string [] args)
  {
    string basedir = AppDomain.CurrentDomain.BaseDirectory;

    if (args.Length == 0) {
      Process p = new Process ();
      p.StartInfo.FileName = "mono";
      p.StartInfo.Arguments = Path.Combine (basedir, "test.exe") + " fork";
      p.Start ();
      p.WaitForExit ();
      Console.WriteLine ("Exit code: " + p.ExitCode);
    } else {
      return 666;
    }

    return 0;
  }
}

Expected result:

The following output is written to stdout:

Exit code: 666

Actual result:

The following output is written to stdout:

Exit code: 154


-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
_______________________________________________
mono-bugs maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-bugs

Reply via email to