Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(347)

Unified Diff: tools/skiaserve/skiaserve.cpp

Issue 1774263002: Fix skiaserve in debug mode (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/skiaserve/skiaserve.cpp
diff --git a/tools/skiaserve/skiaserve.cpp b/tools/skiaserve/skiaserve.cpp
index 889eaafebd2d9c86ff2a4d37d6a366b2c1e5f216..164f59526d0e11b9e46f36de4bde88b5de5da601 100644
--- a/tools/skiaserve/skiaserve.cpp
+++ b/tools/skiaserve/skiaserve.cpp
@@ -13,13 +13,15 @@
#include "microhttpd.h"
#include "urlhandlers/UrlHandler.h"
+
+#include <errno.h>
#include <sys/socket.h>
#include <arpa/inet.h>
using namespace Response;
DEFINE_int32(port, 8888, "The port to listen on.");
-DEFINE_string(address, "localhost", "The address to bind to.");
+DEFINE_string(address, "127.0.0.1", "The address to bind to.");
class UrlManager {
public:
@@ -82,7 +84,12 @@ int skiaserve_main() {
struct sockaddr_in address;
address.sin_family = AF_INET;
address.sin_port = htons(FLAGS_port);
- inet_pton(AF_INET, FLAGS_address[0], &address.sin_addr);
+ int result = inet_pton(AF_INET, FLAGS_address[0], &address.sin_addr);
+ if (result != 1) {
+ printf("inet_pton for %s:%d failed with return %d %s\n",
+ FLAGS_address[0], FLAGS_port, result, strerror(errno));
+ return 1;
+ }
printf("Visit http://%s:%d in your browser.\n", FLAGS_address[0], FLAGS_port);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698