[Vm-dev] OSProcess chdir

Sean P. DeNigris sean at clipperadams.com
Fri May 25 18:33:17 UTC 2012

	(self chdir: path)
		ifTrue: [interpreterProxy pop: 2; push: interpreterProxy nilObject]
		ifFalse: [interpreterProxy pop: 2; pushInteger: errno].

Shouldn't the conditional branches be reversed (or the test be "(self chdir:
path) == 0" - however you would write that in Slang)? chdir returns 0 on
success and -1 on error. In c, the above becomes:
	if (chdir(path))
	else {...interpreterProxy->pushInteger(errno);}
So success takes the else branch and returns the irrelevant errno, which I
guess is why I'm getting confusing error codes in Pharo 2.0 even though the
chdir has taken effect.

b.t.w. if the above is correct, how would I submit a patch (i.e. changes to
the UnixOSProcessPlugin class)? 


View this message in context: http://forum.world.st/OSProcess-chdir-tp4631844.html
Sent from the Squeak VM mailing list archive at Nabble.com.

More information about the Vm-dev mailing list