From f712098323c46213a7658f6b91b3775055bc6d6a Mon Sep 17 00:00:00 2001 From: Robert Foss Date: Wed, 7 Jun 2017 16:49:29 -0400 Subject: [PATCH] server: Add port number to socket bind error Make this error message more useful by providing the port number that we tried to bind to. Change-Id: Ieb18adf0725a6ae99c77ebfaadc49d64ed407bbe Signed-off-by: Robert Foss Reviewed-on: http://openocd.zylin.com/4157 Tested-by: jenkins Reviewed-by: Spencer Oliver --- src/server/server.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/server.c b/src/server/server.c index 8009d408..517d62a7 100644 --- a/src/server/server.c +++ b/src/server/server.c @@ -273,7 +273,7 @@ int add_service(char *name, c->sin.sin_port = htons(c->portnumber); if (bind(c->fd, (struct sockaddr *)&c->sin, sizeof(c->sin)) == -1) { - LOG_ERROR("couldn't bind %s to socket: %s", name, strerror(errno)); + LOG_ERROR("couldn't bind %s to socket on port %d: %s", name, c->portnumber, strerror(errno)); close_socket(c->fd); free_service(c); return ERROR_FAIL; -- 2.39.5