osbuild-composer: fix number of listeners check

Osbuild-composer expects two or three listeners and fails if there is
an unexpected number of listening sockets. Checking if there are not two
or if there are not three listeners always returns true even if there are
the desired number of listeners. Therefore, osbuild-composer always
crashes. The check now only crashes if there are a number of listeners
other than 2 or 3.
This commit is contained in:
Jacob Kozol 2020-01-16 16:59:59 +01:00 committed by Ondřej Budai
parent 6b662663f3
commit 481c1dd048

View file

@ -42,7 +42,7 @@ func main() {
log.Fatalf("Could not get listening sockets: " + err.Error())
}
if len(listeners) != 2 || len(listeners) != 3 {
if len(listeners) != 2 && len(listeners) != 3 {
log.Fatalf("Unexpected number of listening sockets (%d), expected 2 or 3", len(listeners))
}