[GRASS-git] [OSGeo/grass] 3d8c29: lib/gis: Return the child exit status from G_popen...

R Sai Pranav noreply at github.com
Thu Sep 17 01:50:18 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/OSGeo/grass
  Commit: 3d8c29bb38bde121710bab17dc6b2352bb789dfb
      https://github.com/OSGeo/grass/commit/3d8c29bb38bde121710bab17dc6b2352bb789dfb
  Author: R Sai Pranav <rajasaipranav0 at gmail.com>
  Date:   2026-09-17 (Thu, 17 Sep 2026)

  Changed paths:
    M include/grass/defs/gis.h
    M lib/gis/popen.c

  Log Message:
  -----------
  lib/gis: Return the child exit status from G_popen_close (#7847)

G_popen_close() waited for the child but dropped G_wait()'s value, so
callers could not tell whether the child succeeded. That is one of the
links that made #7734 silent.

The value is passed through unchanged, so a caller can treat anything
other than EXIT_SUCCESS as a failure. A state with no process returns 0,
which keeps the function as close as possible to its previous void
behaviour: G_popen_read() and G_popen_write() already return NULL when
G_spawn_ex() fails, and that must be checked long before the pipe is
closed.

G_popen_clear() resets the state afterwards, so a second close does not
wait again.

All 18 files outside popen.c that call G_popen_close discard the value,
so widening the return type from void to int breaks nothing in tree.

Signed-off-by: sai pranav <rajasaipranav0 at gmail.com>



To unsubscribe from these emails, change your notification settings at https://github.com/OSGeo/grass/settings/notifications


More information about the grass-commit mailing list