On 29/09/2022 01:24, Darrick J. Wong wrote:
On Wed, Sep 28, 2022 at 03:53:07PM +1000, Donald Douwsma wrote:
stobj_unpack_sessinfo returns bool_t, fix logic in pi_addfile so errors
can be properly reported.
signed-off-by: Donald Douwsma <ddouwsma@xxxxxxxxxx>
^ Needs correct capitalisation.
With that fixed,
Reviewed-by: Darrick J. Wong <djwong@xxxxxxxxxx>
Will fix for all three patches.
Thanks again,
Don
---
restore/content.c | 13 +++++--------
1 file changed, 5 insertions(+), 8 deletions(-)
diff --git a/restore/content.c b/restore/content.c
index b3999f9..04b6f81 100644
--- a/restore/content.c
+++ b/restore/content.c
@@ -5463,17 +5463,14 @@ pi_addfile(Media_t *Mediap,
* desc.
*/
sessp = 0;
- if (!buflen) {
- ok = BOOL_FALSE;
- } else {
- /* extract the session information from the buffer */
- if (stobj_unpack_sessinfo(bufp, buflen, &sessinfo)<0) {
- ok = BOOL_FALSE;
- } else {
+ ok = BOOL_FALSE;
+ /* extract the session information from the buffer */
+ if (buflen &&
+ stobj_unpack_sessinfo(bufp, buflen, &sessinfo)) {
stobj_convert_sessinfo(&sessp, &sessinfo);
ok = BOOL_TRUE;
- }
}
+
if (!ok || !sessp) {
mlog(MLOG_DEBUG | MLOG_WARNING | MLOG_MEDIA, _(
"on-media session "
--
2.31.1