Open taviso opened 2 years ago
Ah, the bug is that UNIX system()
returns the result, but Linux system()
returns the wait status, and 1-2-3 doesn't know that.
Hmm, on the one hand It's easy to fix (just add WEXITSTATUS()
), but should we fix it? Maybe it's more useful having all the wait()
flags available?
Note: as a workaround you can do @INFO("osreturncode") / 2^8
Actually, SCO OpenServer returns the wait status too: http://osr507doc.sco.com/cgi-bin/man?mansearchword=/usr/man2/html.S/system.S.html&mansection= And Solaris: https://man.freebsd.org/cgi/man.cgi?query=system&apropos=0&sektion=0&manpath=SunOS+5.10&arch=default&format=html So this likely behaved the same even on a supported OS.
FWIW, Windows returns the exit code; I haven't developed anything for DOS but perhaps DOS C libraries do as well.
I think if you do this, the result should be 123:
It isn't, it's
31488
... which is123 << 8
, so maybe it's the wrong endianness or something?