Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
net-tools
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
net-tools
Commits
153ab835
Commit
153ab835
authored
Dec 10, 2011
by
Mike Frysinger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hostname: check return value of getdomainname
Signed-off-by:
Mike Frysinger
<
vapier@gentoo.org
>
parent
9cd07a6f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
hostname.c
hostname.c
+4
-1
No files found.
hostname.c
View file @
153ab835
...
...
@@ -422,7 +422,10 @@ int main(int argc, char **argv)
setdname
(
argv
[
optind
]);
break
;
}
getdomainname
(
myname
,
sizeof
(
myname
));
if
(
getdomainname
(
myname
,
sizeof
(
myname
))
<
0
)
{
perror
(
"getdomainname()"
);
exit
(
1
);
}
if
(
opt_v
)
fprintf
(
stderr
,
_
(
"getdomainname()=`%s'
\n
"
),
myname
);
printf
(
"%s
\n
"
,
myname
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment