Skip to content

Commit

Permalink
fix 32bit compiler error for writev
Browse files Browse the repository at this point in the history
  • Loading branch information
phuslu committed Jun 11, 2024
1 parent ec4e312 commit 90964a0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion async.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"io"
"runtime"
"sync"
"unsafe"
)

// AsyncWriter is an Writer that writes asynchronously.
Expand Down Expand Up @@ -48,7 +49,7 @@ func (w *AsyncWriter) WriteEntry(e *Entry) (int, error) {
w.ch = make(chan *Entry, w.ChannelSize)
w.chClose = make(chan error)
w.file, _ = w.Writer.(*FileWriter)
if w.file != nil && runtime.GOOS == "linux" && !w.WritevDisabled {
if w.file != nil && runtime.GOOS == "linux" && unsafe.Sizeof(uintptr(0)) == 8 && !w.WritevDisabled {
go w.writever()
} else {
go w.writer()
Expand Down
3 changes: 2 additions & 1 deletion async_linux.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
//go:build linux
//go:build linux && (arm64 || amd64 || mips64 || mips64le || ppc64 || ppc64le || riscv64 || s390x || loong64)
// +build linux
// +build arm64 amd64 mips64 mips64le ppc64 ppc64le riscv64 s390x loong64

package log

Expand Down

0 comments on commit 90964a0

Please sign in to comment.