coredump: make use of the iovec-array helpers
authorFranck Bui <fbui@suse.com>
Wed, 26 Jun 2019 09:38:44 +0000 (11:38 +0200)
committerFranck Bui <fbui@suse.com>
Fri, 28 Jun 2019 06:24:09 +0000 (08:24 +0200)
commit9a435388960dbb8a01e4658ddaa9f3f8a11173c5
tree7674971905edadc6a16b19401cd3b495448931f4
parentae41fdb66af358467aa278b1a99c153465bc8bba
coredump: make use of the iovec-array helpers

Previous code was allocating an array of iovecs big enough to store all the
fields added later by various functions.

This forced us to calculate the size of the array in advance which is too error
prone if for example one wants to add new fields or simply rework the
code. Various assertions were added to make sure there's no overflow but it's
still more code for no good reasons.

Instead, this patch switches to the new iovec array handling interface so the
array is grown dynamically when needed.

The other contraint was that some iovecs were supposed to be freed whereas some
others were not. This makes the code hard to (re)organize. The new code always
allocates fields so it becomes easier to rework the code.
src/coredump/coredump.c