aboutsummaryrefslogtreecommitdiff
path: root/www/chromium/files/patch-sync__util__get_session_name_linux.cc
blob: 89133eeeeb20b6a170cfad61f9607a7c7f58c4bd (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
--- ./sync/util/get_session_name_linux.cc.orig	2014-08-12 21:02:55.000000000 +0200
+++ ./sync/util/get_session_name_linux.cc	2014-08-13 09:56:58.000000000 +0200
@@ -13,8 +13,9 @@
 namespace internal {
 
 std::string GetHostname() {
-  char hostname[HOST_NAME_MAX];
-  if (gethostname(hostname, HOST_NAME_MAX) == 0)  // Success.
+  int len = sysconf(_SC_HOST_NAME_MAX);
+  char hostname[len];
+  if (gethostname(hostname, len) == 0)  // Success.
     return hostname;
   return base::GetLinuxDistro();
 }