aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2018-10-16 13:57:24 +0200
committerDmitry Vyukov <dvyukov@google.com>2018-10-16 13:57:24 +0200
commit1ba7fd7e654f91b7ae8559d2889f3c7ff6d08c63 (patch)
tree334e43e130dacf47de04114ff53a96b6dd044e7b
parent8cd30605ce7e7059e454ff712a61e81fbc28de87 (diff)
all: fix code formatting
Reformat, remove debug leftovers, fix comment style.
-rw-r--r--pkg/build/linux_generated.go1
-rw-r--r--pkg/ipc/ipc.go2
-rw-r--r--prog/resources.go11
3 files changed, 1 insertions, 13 deletions
diff --git a/pkg/build/linux_generated.go b/pkg/build/linux_generated.go
index 7b6eff8c0..c2cce9457 100644
--- a/pkg/build/linux_generated.go
+++ b/pkg/build/linux_generated.go
@@ -117,4 +117,3 @@ menuentry 'linux' --class gnu-linux --class gnu --class os {
EOF
sudo grub-install --target=i386-pc --boot-directory=disk.mnt/boot --no-floppy $DISKDEV
`
-
diff --git a/pkg/ipc/ipc.go b/pkg/ipc/ipc.go
index d01761630..e4aed56ce 100644
--- a/pkg/ipc/ipc.go
+++ b/pkg/ipc/ipc.go
@@ -88,7 +88,7 @@ type CallInfo struct {
Flags CallFlags
Signal []uint32 // feedback signal, filled if FlagSignal is set
Cover []uint32 // per-call coverage, filled if FlagSignal is set and cover == true,
- //if dedup == false, then cov effectively contains a trace, otherwise duplicates are removed
+ // if dedup == false, then cov effectively contains a trace, otherwise duplicates are removed
Comps prog.CompMap // per-call comparison operands
Errno int // call errno (0 if the call was successful)
}
diff --git a/prog/resources.go b/prog/resources.go
index 478a6030f..d935beb7a 100644
--- a/prog/resources.go
+++ b/prog/resources.go
@@ -15,24 +15,17 @@ var timespecRes = &ResourceDesc{
}
func (target *Target) calcResourceCtors(kind []string, precise bool) []*Syscall {
-
- //fmt.Printf("calcResourceCtors: kind=%+v\n", kind)
-
// Find calls that produce the necessary resources.
var metas []*Syscall
for _, meta := range target.Syscalls {
// Recurse into arguments to see if there is an out/inout arg of necessary type.
ok := false
- //if meta.Name != "pipe$9p" { continue }
- //fmt.Printf("found pipe$9p\n")
-
ForeachType(meta, func(typ Type) {
if ok {
return
}
switch typ1 := typ.(type) {
case *ResourceType:
- //fmt.Printf(" output: %+v\n", typ1.Desc.Kind)
if typ1.Dir() != DirIn && isCompatibleResourceImpl(kind, typ1.Desc.Kind, precise) {
ok = true
}
@@ -75,11 +68,9 @@ func (target *Target) isCompatibleResource(dst, src string) bool {
// If precise is true, then it does not allow passing a less specialized resource (e.g. fd)
// as a more specialized resource (e.g. socket). Otherwise it does.
func isCompatibleResourceImpl(dst, src []string, precise bool) bool {
- //fmt.Printf("isCompatibleResourceImpl: %+v/%v vs %+v/%v\n", dst, len(dst), src, len(src))
if len(dst) > len(src) {
// dst is more specialized, e.g dst=socket, src=fd.
if precise {
- //fmt.Printf(" = false1\n")
return false
}
dst = dst[:len(src)]
@@ -90,11 +81,9 @@ func isCompatibleResourceImpl(dst, src []string, precise bool) bool {
}
for i, k := range dst {
if k != src[i] {
- //fmt.Printf(" = false2\n")
return false
}
}
- //fmt.Printf(" = true\n")
return true
}