• Kevin Locke's avatar
    configurator: Reimplement run using popen · 93992ee3
    Kevin Locke authored
    Rather than using fork+pipe+system+waitpid, most of which are only
    available on POSIX-like systems, use popen which is also available on
    Windows (under the name _popen).
    
    Changes since v1:
    - Create fread_noeintr to avoid EINTR in fread without reading any data.
    - Handle short reads from fread.  This can happen with non-conformant
      libc or if EINTR occurs after reading some data.
    - Define _POSIX_C_SOURCE for popen/pclose with strict implementations
      which require it (e.g. gcc with -std=c11).
    
    Changes since v2:
    - Revert fread_noeintr and short read changes in v1 as unnecessary.
    Signed-off-by: default avatarKevin Locke <kevin@kevinlocke.name>
    Signed-off-by: default avatarDavid Gibson <david@gibson.dropbear.id.au>
    93992ee3
configurator.c 19.9 KB