[GRASS-dev] How to check return code of subprocess in C

Vaclav Petras wenzeslaus at gmail.com
Sat Feb 1 15:19:09 PST 2014


Hi,

how should the C module check if the subprocess succeeded, i.e. what is
subprocess return code.

I just committed fix for r.mode (1) and before the fix, r.mode was
pretending that everything is all right although it was not (r.reclass
failed and printed help). Now the r.reclass does not fail and r.mode works,
however there is still the check of return code missing.

So, the question is, how to deal with the failed subprocess when using
G_popen_write and G_popen_close function as in case of r.mode.
Unfortunately, ./lib/gis/popen.c does not contain any documentation, so
that's why I'm asking.

Thanks,
Vaclav


[r58838] https://trac.osgeo.org/grass/changeset/58838
(1) Is anybody using r.mode? The bug was there for a long time.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-dev/attachments/20140201/9faa887c/attachment.html>


More information about the grass-dev mailing list