mirror of
https://github.com/RGBCube/serenity
synced 2025-05-14 09:24:57 +00:00
hostname: Handle 'sethostname' errors
This commit is contained in:
parent
d840608a51
commit
bee1e06055
1 changed files with 5 additions and 1 deletions
|
@ -31,7 +31,11 @@ int main(int argc, char** argv)
|
|||
warnln("Hostname must be less than {} characters", HOST_NAME_MAX);
|
||||
return 1;
|
||||
}
|
||||
sethostname(hostname, strlen(hostname));
|
||||
int rc = sethostname(hostname, strlen(hostname));
|
||||
if (rc < 0) {
|
||||
perror("sethostname");
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue