From a9be2d378b7ad84e679a48efa81f42fb54f85d9a Mon Sep 17 00:00:00 2001 From: Jean-Michel Trivi Date: Wed, 15 Jul 2015 15:37:57 -0700 Subject: Drop release v2.6.0+no-stlport Bug 246391 Change-Id: I662b7b0f90c97cb169978e1b64ad1fe32c440cf5 Signed-off-by: Jean-Michel Trivi --- remote-processor/ListeningSocket.cpp | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'remote-processor/ListeningSocket.cpp') diff --git a/remote-processor/ListeningSocket.cpp b/remote-processor/ListeningSocket.cpp index 1677d71..191d412 100644 --- a/remote-processor/ListeningSocket.cpp +++ b/remote-processor/ListeningSocket.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011-2014, Intel Corporation + * Copyright (c) 2011-2015, Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, @@ -39,6 +39,7 @@ #include #include +#include #define base CSocket @@ -52,7 +53,7 @@ CListeningSocket::CListeningSocket() } // Listen -bool CListeningSocket::listen(uint16_t uiPort) +bool CListeningSocket::listen(uint16_t uiPort, string &strError) { struct sockaddr_in server_addr; @@ -62,19 +63,17 @@ bool CListeningSocket::listen(uint16_t uiPort) // Bind if (bind(getFd(), (struct sockaddr*)&server_addr, sizeof(struct sockaddr)) == -1) { - std::ostringstream oss; - oss << "CListeningSocket::listen::bind port " << uiPort; - perror(oss.str().c_str()); - + std::ostringstream oss; + oss << uiPort; + strError = "Could not bind socket to port " + oss.str() + ": " + strerror(errno); return false; } if (::listen(getFd(), 5) == -1) { - std::ostringstream oss; - oss << "CListeningSocket::listen::bind port " << uiPort; - perror(oss.str().c_str()); - + std::ostringstream oss; + oss << uiPort; + strError = "Could not listen to port " + oss.str() + ": " + strerror(errno); return false; } return true; -- cgit v1.1