mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 17:47:44 +00:00
LibCore: Use non-const char * for sethostname on Solaris
This commit is contained in:
parent
cdd1c8d0d9
commit
8687dae0ca
1 changed files with 4 additions and 0 deletions
|
@ -576,7 +576,11 @@ ErrorOr<DeprecatedString> gethostname()
|
|||
|
||||
ErrorOr<void> sethostname(StringView hostname)
|
||||
{
|
||||
#if defined(AK_OS_SOLARIS)
|
||||
int rc = ::sethostname(const_cast<char*>(hostname.characters_without_null_termination()), hostname.length());
|
||||
#else
|
||||
int rc = ::sethostname(hostname.characters_without_null_termination(), hostname.length());
|
||||
#endif
|
||||
if (rc < 0)
|
||||
return Error::from_syscall("sethostname"sv, -errno);
|
||||
return {};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue