Xinqi Bao's Git
projects
/
slstatus.git
/ blob
summary
|
log
|
commit
|
diff
|
tree
history
|
raw
|
HEAD
ram: Consistency with line breaks
[slstatus.git]
/
components
/
hostname.c
1
/* See LICENSE file for copyright and license details. */
2
#include <stdio.h>
3
#include <unistd.h>
4
5
#include
"../util.h"
6
7
const char
*
8
hostname
(
void
)
9
{
10
if
(
gethostname
(
buf
,
sizeof
(
buf
)) <
0
) {
11
warn
(
"gethostbyname:"
);
12
return
NULL
;
13
}
14
15
return
buf
;
16
}