Skip to content

Commit 8103742

Browse files
author
James Cor
committed
Merge branch 'main' into james/update
2 parents c505db7 + 1fde9d5 commit 8103742

File tree

5 files changed

+10
-8
lines changed

5 files changed

+10
-8
lines changed

internal/sockstate/netstat_darwin.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,10 @@ func tcpSocks(accept AcceptFn) ([]sockTabEntry, error) {
3232
}
3333

3434
func GetConnInode(c *net.TCPConn) (uint64, error) {
35-
_, err := getConnFd(c)
35+
_, finalize, err := getConnFd(c)
3636
if err != nil {
3737
return 0, err
3838
}
39+
defer finalize()
3940
return 0, ErrSocketCheckNotImplemented.New()
4041
}

internal/sockstate/netstat_freebsd.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,10 @@ func tcpSocks(accept AcceptFn) ([]sockTabEntry, error) {
3232
}
3333

3434
func GetConnInode(c *net.TCPConn) (uint64, error) {
35-
_, err := getConnFd(c)
35+
_, finalize, err := getConnFd(c)
3636
if err != nil {
3737
return 0, err
3838
}
39+
defer finalize()
3940
return 0, ErrSocketCheckNotImplemented.New()
4041
}

internal/sockstate/netstat_linux.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,10 +279,11 @@ func tcpSocks(accept AcceptFn) ([]sockTabEntry, error) {
279279

280280
// GetConnInode returns the inode number of an fd.
281281
func GetConnInode(conn *net.TCPConn) (n uint64, err error) {
282-
fd, err := getConnFd(conn)
282+
fd, finalize, err := getConnFd(conn)
283283
if err != nil {
284284
return 0, err
285285
}
286+
defer finalize()
286287

287288
if isWSL || isProcBlocked {
288289
return 0, ErrSocketCheckNotImplemented.New()

internal/sockstate/netstat_unix.go

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ import (
2222
"syscall"
2323
)
2424

25-
func getConnFd(c *net.TCPConn) (fd uintptr, err error) {
25+
func getConnFd(c *net.TCPConn) (fd uintptr, finalize func() error, err error) {
2626
f, err := c.File()
2727
if err != nil {
28-
return 0, err
28+
return 0, nil, err
2929
}
3030

3131
fd = f.Fd()
@@ -34,7 +34,5 @@ func getConnFd(c *net.TCPConn) (fd uintptr, err error) {
3434
// blocking Close() in some cases.
3535
syscall.SetNonblock(int(fd), true)
3636

37-
f.Close()
38-
39-
return fd, nil
37+
return fd, f.Close, nil
4038
}

sql/planbuilder/from.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -843,6 +843,7 @@ func (b *Builder) resolveView(name string, database sql.Database, asOf interface
843843
create, ok := node.(*plan.CreateView)
844844
if !ok {
845845
err = fmt.Errorf("expected create view statement, found: %T", node)
846+
b.handleErr(err)
846847
}
847848
switch n := create.Child.(type) {
848849
case *plan.SubqueryAlias:

0 commit comments

Comments
 (0)