LibCore: Use non-const char * for sethostname on Solaris
This commit is contained in:
parent
cdd1c8d0d9
commit
8687dae0ca
Notes:
sideshowbarker
2024-07-19 16:55:29 +09:00
Author: https://github.com/ghost Commit: https://github.com/SerenityOS/serenity/commit/8687dae0ca2 Pull-request: https://github.com/SerenityOS/serenity/pull/17623 Reviewed-by: https://github.com/ADKaster ✅ Reviewed-by: https://github.com/elcuco Reviewed-by: https://github.com/kleinesfilmroellchen ✅ Reviewed-by: https://github.com/linusg
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
Reference in a new issue