Separate payload archive close and free
authorPanu Matilainen <pmatilai@redhat.com>
Wed, 18 Apr 2012 07:30:11 +0000 (10:30 +0300)
committerPanu Matilainen <pmatilai@redhat.com>
Wed, 18 Apr 2012 07:30:11 +0000 (10:30 +0300)
commit3c2be9072df9c41159d57e0021faaff62d5dfcb4
treed8260f543fe5f2922cdc5a119987fcfa5fb4075e
parent4c1f7e335de1724661ce63c53186d161ab71a63f
Separate payload archive close and free

- When writing, archive finalization can write further data into
  the payload (eg cpio trailer). We need to be able to fish the
  final archive size *after* closing it, otherwise archive size
  will be off by trailer size.
- Add new rpmcpioFree() function which simpy frees the archive struct,
  calling rpmcpioClose() in the process if it wasn't already done.
- This also simplifies the error code gymnastics in fsm: we need to
  free the resources whether error or not, which rpmcpioFree() allows
  us to do. And for writers, calling rpmcpioClose() only needs to
  be done if earlier parts were successfull, so we dont need to worry
  about masking a former error code when calling it.
lib/cpio.c
lib/cpio.h
lib/fsm.c