in_tail: avoid locking files on Windows (#1159)
in_tail: avoid locking files on Windows (#1159)

Previously, flb_tail_file_append() used POSIX open(2) to open log files.
The problem with this approach was that it silently acquires a delete
lock on the file, and thus can interfere with file maintenance operations
performed by the logging process (like log file rotation).

    PS > rm access.log
    rm : cannot remove item access.log: The access cannot access the
    file 'access.log' because it is being used by another process.

This patch resolves the issue by using CreateFile() instead of POSIX open()
and enabling resource sharing (FILE_SHARE_*) explicitly.

Signed-off-by: Fujimoto Seiji <ef879192bb1e41d519c82cf76440dc8e9a530806@clear-code.com>
nokute78/fluent-bit,fluent/fluent-bit,nokute78/fluent-bit,nokute78/fluent-bit,fluent/fluent-bit,nokute78/fluent-bit,fluent/fluent-bit,fluent/fluent-bit,nokute78/fluent-bit,fluent/fluent-bit,fluent/fluent-bit,nokute78/fluent-bit,nokute78/fluent-bit,fluent/fluent-bit,nokute78/fluent-bit,fluent/fluent-bit,fluent/fluent-bit,nokute78/fluent-bit,fluent/fluent-bit,fluent/fluent-bit,nokute78/fluent-bit,nokute78/fluent-bit,fluent/fluent-bit,nokute78/fluent-bit