Report failure when gtavi-probe cannot write its output #35

Open
github-bot wants to merge 1 commit from github-bot/gh-35 into main AGit
Owner

@⁠RavenCurseBurg on GitHub · 2026-11-26 07:28 UTC · original
RavenCurseBurg:fix/probe-output-status → main · +28 −6 · 3 files · 1 commits · open

A caller could receive exit status 0 after the probe lost its host report or translated path. A short redirected write can fit in the C stdio buffer and fail only at exit, after the probe has chosen its result.

The probe now flushes stdout and checks its error indicator before returning. A failed write produces a diagnostic on stderr and status 1. An existing usage error retains status 2.

Verification

  • On Windows x64 with MinGW-w64 GCC 15.2, passing a read-only file handle as stdout reproduced the false success on main for the default report, help and a single translation. Each now returns 1. A 14,490-byte report still detects the failure and an invalid option still returns 2.
  • With writable stdout, all five cases produced byte-identical stdout before and after. The warning-as-error Release build and all three Windows CTests passed.
  • The new native Linux CTest redirects a short translation to /dev/full and checks both status 1 and the diagnostic.

AI-assisted with Codex + GPT-6.2 Astra (xhigh).

**@⁠RavenCurseBurg** on GitHub · 2026-11-26 07:28 UTC · [original](https://github.com/JamesCicada/GTAVI-Recomp/pull/35) `RavenCurseBurg:fix/probe-output-status` → `main` · +28 −6 · 3 files · 1 commits · open A caller could receive exit status 0 after the probe lost its host report or translated path. A short redirected write can fit in the C stdio buffer and fail only at exit, after the probe has chosen its result. The probe now flushes stdout and checks its error indicator before returning. A failed write produces a diagnostic on stderr and status 1. An existing usage error retains status 2. ### Verification - On Windows x64 with MinGW-w64 GCC 15.2, passing a read-only file handle as stdout reproduced the false success on `main` for the default report, help and a single translation. Each now returns 1. A 14,490-byte report still detects the failure and an invalid option still returns 2. - With writable stdout, all five cases produced byte-identical stdout before and after. The warning-as-error Release build and all three Windows CTests passed. - The new native Linux CTest redirects a short translation to `/dev/full` and checks both status 1 and the diagnostic. AI-assisted with Codex + GPT-6.2 Astra (xhigh).
Flush stdout and check for a prior stream error before reporting success. Keep the usage status when both argument parsing and the write fail. Exercise a deferred error from /dev/full in native Linux CTest.

AI-assisted with Codex + GPT-6.2 Astra (xhigh).
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 20:44:53 +00:00
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/35/head:github-bot/gh-35'
git switch 'github-bot/gh-35'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-35'
git switch 'github-bot/gh-35'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-35'
git switch 'github-bot/gh-35'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-35'
git switch 'main'
git merge --squash 'github-bot/gh-35'
git switch 'main'
git merge --ff-only 'github-bot/gh-35'
git switch 'main'
git merge 'github-bot/gh-35'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.