diff options
author | Frédéric Boisnard <fredericx.boisnard@intel.com> | 2014-02-13 17:46:41 +0100 |
---|---|---|
committer | Mattijs Korpershoek <mattijsx.korpershoek@intel.com> | 2014-06-23 18:13:53 +0200 |
commit | 0d10a8a19f4aadde2d65892a08831a56cd5e53bc (patch) | |
tree | b1d873061b9be92468f739b0fb016c5ffee664f4 /tools | |
parent | 93f402c37a314a83b877cd95e1a2c464bf26d8e2 (diff) | |
download | external_parameter-framework-0d10a8a19f4aadde2d65892a08831a56cd5e53bc.zip external_parameter-framework-0d10a8a19f4aadde2d65892a08831a56cd5e53bc.tar.gz external_parameter-framework-0d10a8a19f4aadde2d65892a08831a56cd5e53bc.tar.bz2 |
Fix hostDomainGenerator.sh error about localhost socket creation
BZ: 171573
If localhost is not bound to 127.0.0.1, socket creation fails in the
portAllocator.py script. This error is not well catched in the main
tool hostDomainGenerator.sh.
This patch updates portAllocator.py so that the IP address 127.0.0.1
is used instead of localhost. In addition, the potential error messages
raised by portAllocator.py are now correctly taken into account by
hostDomainGenerator.sh. HostDomainGenerator.sh has also been updated
to replace all instances of 'localhost' by '127.0.0.1'.
Change-Id: I7ed6ede7a1148360efac4bf38f49054066a50a29
Signed-off-by: Frédéric Boisnard <fredericx.boisnard@intel.com>
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/xmlGenerator/hostDomainGenerator.sh | 4 | ||||
-rwxr-xr-x | tools/xmlGenerator/portAllocator.py | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/tools/xmlGenerator/hostDomainGenerator.sh b/tools/xmlGenerator/hostDomainGenerator.sh index 5b27513..a6e5f37 100755 --- a/tools/xmlGenerator/hostDomainGenerator.sh +++ b/tools/xmlGenerator/hostDomainGenerator.sh @@ -64,8 +64,8 @@ hostConfig="hostConfig.py" PFWScriptGenerator="PFWScriptGenerator.py" portAllocator="portAllocator.py" -TPHost=localhost -PFWHost=localhost +TPHost=127.0.0.1 +PFWHost=127.0.0.1 TPCreated=false HostRoot="$ANDROID_HOST_OUT" diff --git a/tools/xmlGenerator/portAllocator.py b/tools/xmlGenerator/portAllocator.py index 79a1c6b..64e1175 100755 --- a/tools/xmlGenerator/portAllocator.py +++ b/tools/xmlGenerator/portAllocator.py @@ -32,8 +32,8 @@ import sys, socket serversock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) try: - # Create a listening socket on a random available port - serversock.bind(('localhost',0)) + # Create a listening socket on a random available port on localhost + serversock.bind(('127.0.0.1',0)) serversock.listen(0) # Print the chosen port @@ -41,7 +41,7 @@ try: serversock.close() except socket.error, (errno,message): - print("Socket creation error " + str(errno) + ": " + message) + sys.stderr.write("portAllocator: Socket creation error " + str(errno) + ": " + message + '\n') if serversock: serversock.close() sys.exit(1) |