fix hang when built with unix-2.8
authorJoey Hess <joeyh@joeyh.name>
Wed, 2 Aug 2023 00:17:29 +0000 (20:17 -0400)
committerJoey Hess <joeyh@joeyh.name>
Wed, 2 Aug 2023 00:22:28 +0000 (20:22 -0400)
commit3a52b4c4c35baa85b7d55a73df3e48b19b1a8ddf
tree4198d394986e39e7ac6afcb90b5cfc12b6adf313
parent6da6449fff405c1747a062be40df233aecf81540
fix hang when built with unix-2.8

git-annex test hang when running git-annex add in an adjusted unlocked
branch. I couldn't seem to reproduce the hang outside the test suite.

Seems that the code added in 26a9ea12d11f85b43987d863449c790f7320d9d1
was buggy, and as that commit was made without testing it, building with
unix-2.8 exposed the bug.

I don't fully understand the bug, which involves fdToHandle
and then closing the fd, vs closing the handle. May somehow involve
laziness or forcing around the S.hGet? Using hClose solved it
in any case.

(Also eliminated checkcontentfollowssymlinks to fix a build warning
when it's not used.)
Annex/Link.hs