Skip to content
Snippets Groups Projects

Fix error handling with getline

Closed Walter Lozano requested to merge wip/wlozano/getline-fix-v2021 into apertis/v2021-updates

The function getline is used to read data from different streams, however, the error handling is not accurate.

From the man page, getline returns -1 on failure and sets errno accordingly, but the current implementation only checks errno to see if there was a failure. With this approach, in case getline returns success but also sets errno it is consider and error.

Fix the issue but also checking the return value of getline.

Forwarded: https://salsa.debian.org/apt-team/apt/-/merge_requests/265

https://phabricator.apertis.org/T9316

Signed-off-by: Walter Lozano walter.lozano@collabora.com

Edited by Walter Lozano

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Loading
  • Loading
  • Loading
Please register or sign in to reply
Loading