HomeFreeBSD

sort: Fix message catalogue usage

Description

sort: Fix message catalogue usage

  • Check that catopen() succeeded before calling catclose(). musl will crash in the latter if the catalogue descriptor is -1.
  • Keep the message catalogue open for most of sort(1)'s actual operation.
  • Don't use catgets(3) to print error messages if catopen(3) had failed.

Reviewed by: arichardson, emaste
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D34081

Details

Provenance
markjAuthored on Jan 28 2022, 5:49 PM
Reviewer
arichardson
Differential Revision
D34081: sort: Fix message catalogue usage
Parents
rG29d481ae6a19: Make <vm/vm_extern.h> more self-contained.
Branches
Unknown
Tags
Unknown