Skip to content
Snippets Groups Projects
Commit 3c3a8836 authored by Tobias Klauser's avatar Tobias Klauser Committed by Gopher Robot
Browse files

os: avoid second fcntl syscall in NewFile on unix

CL 494915 introduced an additional fcntl(F_GETFL) syscall to determine
whether the file is in append-only mode. The existing unix.IsNonblock
call also issues an fcntl(F_GETFL) syscall. The two can be combined and
both the append-only mode and the non-blocking flags can be determined
from that syscall's result.

Change-Id: I915589ed94e079f6abaa2fd0032ef01f78698f7f
Reviewed-on: https://go-review.googlesource.com/c/go/+/497075


Reviewed-by: default avatarIan Lance Taylor <iant@google.com>
Reviewed-by: default avatarBryan Mills <bcmills@google.com>
Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
parent c0b860ba
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment