Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Extra libraries, Code snippets, applications etc. » OS Problems etc., Win32, POSIX, MacOS, FreeBSD, X11 etc » [solved] Linux LocalProcess::GetExitCode highly divergent from Windows
[solved] Linux LocalProcess::GetExitCode highly divergent from Windows [message #48734] Sat, 02 September 2017 10:55 Go to next message
cbpporter is currently offline  cbpporter
Messages: 1400
Registered: September 2007
Senior Contributor
Under Linux, LocalPRocess does not give me the exact exit code the child process gave.

Created this sample app duo:
lpchild package:
#include <Core/Core.h>

using namespace Upp;

CONSOLE_APP_MAIN
{
	SetExitCode(-42);
	Cout() << "Exited with " << GetExitCode() << "!\n";
}



lpparent package:
#include <Core/Core.h>

using namespace Upp;

CONSOLE_APP_MAIN
{
	LocalProcess lp("lpchild");
	String t, tt;
	while (lp.Read(t)) {
		if (t.GetCount())
			tt << t;
	}
	Cout() << "Child said:\n";
	Cout() << tt;
	Cout() << "Child exited with: " << lp.GetExitCode() << "\n";
}


output:
Child said:
Exited with -42!
Child exited with: 214


I saw no other API member that could give the real code.

[Updated on: Sat, 02 September 2017 11:26]

Report message to a moderator

Re: Linux LocalProcess::GetExitCode highly divergent from Windows [message #48735 is a reply to message #48734] Sat, 02 September 2017 11:21 Go to previous message
cbpporter is currently offline  cbpporter
Messages: 1400
Registered: September 2007
Senior Contributor
OK, looks like this is not an U++ issue but a standard Linux limitation. Return codes are 8 bit. Welcome to 2017!

I guess I need to come up with a standardized API to report error across Linux and Windows, because 0 is valid on Linux, but other positives are error and positives are success on Windows...
Previous Topic: TopWindow has size/maximize issues under Linux
Next Topic: How's the Mac support?
Goto Forum:
  


Current Time: Tue Nov 19 13:48:47 CET 2019

Total time taken to generate the page: 0.01547 seconds