lib/pattern: Support binary pattern buffers on windows
authorLogan Gunthorpe <logang@deltatee.com>
Fri, 18 Nov 2022 23:16:00 +0000 (16:16 -0700)
committerVincent Fu <vincent.fu@samsung.com>
Sat, 19 Nov 2022 00:36:10 +0000 (19:36 -0500)
commit1fb215e991d260a128e35d761f6850e8d9e4c333
tree06a413ffdcbeedac25efd3908882111dcf257d36
parent1dc47d6bccb7c64ee8cd3923e5ec9e8d3bb8a96e
lib/pattern: Support binary pattern buffers on windows

On windows, binary files used as pattern buffers may be mangled or
truncated seeing the files are openned in text mode.

Fix this by passing O_BINARY on windows when openning the file.

Suggested-by: Vincent Fu <vincentfu@gmail.com>
Signed-off-by: Logan Gunthorpe <logang@deltatee.com>
Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
lib/pattern.c