]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
split: reset errno prior to getline()
authorMath Ieu <sigsys@gmail.com>
Thu, 27 Oct 2022 17:01:57 +0000 (12:01 -0500)
committerKyle Evans <kevans@FreeBSD.org>
Thu, 27 Oct 2022 17:17:59 +0000 (12:17 -0500)
commit172be8642d93851b0c083d0db240cf35fd56ab0e
tree3485a87f43ea6578ede2a9f3527c61b6a3edbbd8
parentff270fce1631cdfbf8d3d76b9a9f5342b78972c9
split: reset errno prior to getline()

Something else may have set errno, breaking the post-getline() logic
that tries to detect the getline() error.  This was initially noted in
a jail on a system that has HPET, in a jail that does not expose
/dev/hpet0 -- we see an earlier error in libc's vdso bits.

Fixes: 5c053aa3c5e90 ("split: switch to getline() [...]")
usr.bin/split/split.c