Differential D30062 Diff 100093 www/chromium/files/patch-components_sync__device__info_local__device__info__util__linux.cc
Changeset View
Changeset View
Standalone View
Standalone View
www/chromium/files/patch-components_sync__device__info_local__device__info__util__linux.cc
--- components/sync_device_info/local_device_info_util_linux.cc.orig 2021-04-14 18:41:01 UTC | --- components/sync_device_info/local_device_info_util_linux.cc.orig 2021-04-27 04:07:31 UTC | ||||
+++ components/sync_device_info/local_device_info_util_linux.cc | +++ components/sync_device_info/local_device_info_util_linux.cc | ||||
@@ -38,8 +38,9 @@ std::string GetPersonalizableDeviceNameInternal() { | @@ -38,8 +38,8 @@ std::string GetPersonalizableDeviceNameInternal() { | ||||
#if BUILDFLAG(IS_CHROMEOS_ASH) | #if BUILDFLAG(IS_CHROMEOS_ASH) | ||||
return GetChromeOSDeviceNameFromType(); | return GetChromeOSDeviceNameFromType(); | ||||
#else | #else | ||||
- char hostname[HOST_NAME_MAX]; | - char hostname[HOST_NAME_MAX]; | ||||
- if (gethostname(hostname, HOST_NAME_MAX) == 0) // Success. | - if (gethostname(hostname, HOST_NAME_MAX) == 0) // Success. | ||||
+ int len = sysconf(_SC_HOST_NAME_MAX); | + char hostname[_POSIX_HOST_NAME_MAX]; | ||||
+ char hostname[len]; | + if (gethostname(hostname, _POSIX_HOST_NAME_MAX) == 0) // Success. | ||||
+ if (gethostname(hostname, _SC_HOST_NAME_MAX) == 0) // Success. | |||||
return hostname; | return hostname; | ||||
return base::GetLinuxDistro(); | return base::GetLinuxDistro(); | ||||
#endif | #endif |