mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-11 18:20:43 +09:00
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: 8687dae0ca
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
Add a link
Reference in a new issue