style feedback: remove newlines, fix import, remove stray comment

This commit is contained in:
cweld510
2024-10-07 22:39:13 +00:00
parent 727bc9c72a
commit db4ffada10
2 changed files with 5 additions and 9 deletions
+4 -4
View File
@@ -70,7 +70,7 @@ import (
"gvisor.dev/gvisor/pkg/sentry/pgalloc"
"gvisor.dev/gvisor/pkg/sentry/platform"
"gvisor.dev/gvisor/pkg/sentry/socket/netlink/port"
unixsocket "gvisor.dev/gvisor/pkg/sentry/socket/unix/transport"
"gvisor.dev/gvisor/pkg/sentry/socket/unix/transport"
sentrytime "gvisor.dev/gvisor/pkg/sentry/time"
"gvisor.dev/gvisor/pkg/sentry/unimpl"
uspb "gvisor.dev/gvisor/pkg/sentry/unimpl/unimplemented_syscall_go_proto"
@@ -390,7 +390,7 @@ type Kernel struct {
lastCheckpointStatus error `state:"nosave"`
// UnixSocketOpts stores configuration options for management of unix sockets.
UnixSocketOpts unixsocket.UnixSocketOpts
UnixSocketOpts transport.UnixSocketOpts
}
// Saver is an interface for saving the kernel.
@@ -451,14 +451,14 @@ type InitKernelArgs struct {
MaxFDLimit int32
// UnixSocketOpts contains configuration options for unix sockets.
UnixSocketOpts unixsocket.UnixSocketOpts
UnixSocketOpts transport.UnixSocketOpts
}
// Init initialize the Kernel with no tasks.
//
// Callers must manually set Kernel.Platform and call Kernel.SetMemoryFile
// before calling Init.
func (k *Kernel) Init(args InitKernelArgs) error { // TODO (colin) propagate up
func (k *Kernel) Init(args InitKernelArgs) error {
if args.Timekeeper == nil {
return fmt.Errorf("args.Timekeeper is nil")
}
+1 -5
View File
@@ -98,7 +98,6 @@ func (c *HostConnectedEndpoint) init() *syserr.Error {
}
func (c *HostConnectedEndpoint) initFromOptions() *syserr.Error {
if c.fd < 0 {
// There is no underlying FD to restore; nothing to do
return nil
@@ -207,7 +206,6 @@ func (c *HostConnectedEndpoint) CloseSend() {
// Preconditions: c.mu must be held.
func (c *HostConnectedEndpoint) closeSendLocked() {
if c.IsSendClosed() {
return
}
@@ -328,7 +326,6 @@ func (c *HostConnectedEndpoint) CloseRecv() {
// Preconditions: c.mu must be held.
func (c *HostConnectedEndpoint) closeRecvLocked() {
if c.IsRecvClosed() {
return
}
@@ -455,7 +452,7 @@ func (e *SCMConnectedEndpoint) Release(ctx context.Context) {
e.mu.Lock()
defer e.mu.Unlock()
if e.fd == -1 {
if e.fd < 0 {
return
}
@@ -464,7 +461,6 @@ func (e *SCMConnectedEndpoint) Release(ctx context.Context) {
log.Warningf("Failed to close host fd %d: %v", err)
}
e.destroyLocked()
})
}