Skip to content
Snippets Groups Projects

Fix error handling with getline

Merged Walter Lozano requested to merge wip/wlozano/getline-fix into apertis/v2022-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

Merge request pipeline #433806 passed

Pipeline: apt

#433812

    Merge request pipeline passed for 1527d667

    Deployed to upload/wip/wloz‎ano/getline-fix‎ 2 years ago
    Approval is optional

    Merged by Emanuele AinaEmanuele Aina 2 years ago (Nov 7, 2022 10:27am UTC)

    Merge details

    • Changes merged into apertis/v2022-updates with 1527d667.
    • Deleted the source branch.

    Pipeline #434443 passed

    Pipeline: apt

    #434445

      Pipeline passed for 1527d667 on apertis/v2022-updates

      Deployed to upload/apertis‎/v2022-updates‎ 2 years ago

      Activity

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