]> git.ipfire.org Git - thirdparty/public-inbox.git/commit
xap_helper: stricter and harsher error handling
authorEric Wong <e@80x24.org>
Mon, 13 Nov 2023 13:15:47 +0000 (13:15 +0000)
committerEric Wong <e@80x24.org>
Mon, 13 Nov 2023 21:55:06 +0000 (21:55 +0000)
commite9265f8b215ffa24ef4eccd0a7060f3dddc855a9
treeb181287779245fb4f2b9a138febb645d158947f3
parentedf8babee1b1cf130f394d0fedf999c858fbc91d
xap_helper: stricter and harsher error handling

We'll require an error stream for dump_ibx and dump_roots
commands; they're too important to ignore.  Instead of writing
code to provide diagnostics for errors, rely on abort(3) and the
-ggdb3 compiler flag to generate nice core dumps for gdb since
all commands sent to xap_helper are from internal users.
We'll even abort on most usage errors since they could be
bugs in split2argv or our use of getopt(3).

We'll also just exit on ENOMEM errors since it's the easiest way
to recover from those errors by starting a new process which
closes all open Xapian DB handles.
lib/PublicInbox/XapHelper.pm
lib/PublicInbox/xap_helper.h
t/xap_helper.t