Skip to content

Commit

Permalink
tidy
Browse files Browse the repository at this point in the history
  • Loading branch information
lesismal committed Jan 18, 2024
1 parent d1c756e commit 39b4050
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sendfile_unix.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ func (c *Conn) Sendfile(f *os.File, remain int64) (int64, error) {
remain = size - offset
}

var src int
src := int(f.Fd())
if len(c.writeList) > 0 {
src, err = syscall.Dup(int(f.Fd()))
src, err = syscall.Dup(src)
if err != nil {
c.closeWithErrorWithoutLock(err)
return 0, err
Expand Down

0 comments on commit 39b4050

Please sign in to comment.