mirror of
https://github.com/minio/minio.git
synced 2025-11-20 01:50:24 -05:00
Adding return error value to checkPortAvailability to enable testing of function. Adding checkport_test.go to test checkPortAvailability. Updated server-main.go to use error value from checkPortAvailability and calls fatalIf if an error is returned. (#2322)
This commit is contained in:
committed by
Harshavardhana
parent
cf9ba7b88f
commit
851d05161a
@@ -246,7 +246,9 @@ func serverMain(c *cli.Context) {
|
||||
serverAddress := c.String("address")
|
||||
|
||||
// Check if requested port is available.
|
||||
checkPortAvailability(getPort(serverAddress))
|
||||
port := getPort(serverAddress)
|
||||
err := checkPortAvailability(port)
|
||||
fatalIf(err, "Port unavailable %d", port)
|
||||
|
||||
// Disks to be ignored in server init, to skip format healing.
|
||||
ignoredDisks := strings.Split(c.String("ignore-disks"), ",")
|
||||
@@ -268,7 +270,6 @@ func serverMain(c *cli.Context) {
|
||||
printStartupMessage(endPoints)
|
||||
|
||||
// Start server.
|
||||
var err error
|
||||
// Configure TLS if certs are available.
|
||||
if tls {
|
||||
err = apiServer.ListenAndServeTLS(mustGetCertFile(), mustGetKeyFile())
|
||||
|
||||
Reference in New Issue
Block a user