Compare commits
1 Commits
cgroup-nam
...
vapier
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
49ec9a868f |
@@ -451,12 +451,33 @@ handle_signal(int sig)
|
||||
errno = serrno;
|
||||
}
|
||||
|
||||
static void
|
||||
do_early_hostname(void)
|
||||
{
|
||||
#ifdef __linux__
|
||||
/* Set hostname if available */
|
||||
char *buffer = NULL;
|
||||
size_t len;
|
||||
|
||||
if (rc_getfile(RC_SYSCONFDIR "/hostname", &buffer, &len)) {
|
||||
if (buffer[len - 2] == '\n')
|
||||
buffer[--len - 1] = '\0';
|
||||
if (sethostname(buffer, len)) {
|
||||
/* ignore */;
|
||||
}
|
||||
free(buffer);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
static void
|
||||
do_sysinit(void)
|
||||
{
|
||||
struct utsname uts;
|
||||
const char *sys;
|
||||
|
||||
do_early_hostname();
|
||||
|
||||
/* exec init-early.sh if it exists
|
||||
* This should just setup the console to use the correct
|
||||
* font. Maybe it should setup the keyboard too? */
|
||||
|
||||
Reference in New Issue
Block a user