klibc-bot for Maciej Żenczykowski
2012-Jun-28 15:36 UTC
[klibc] [klibc:master] Fix gethostname()/getdomainname()
Commit-ID: 1a6f222b01cead2ec48556203f0e200107eb4c2f Gitweb: http://git.kernel.org/?p=libs/klibc/klibc.git;a=commit;h=1a6f222b01cead2ec48556203f0e200107eb4c2f Author: Maciej ?enczykowski <maze at google.com> AuthorDate: Wed, 27 Jun 2012 18:07:02 -0700 Committer: maximilian attems <max at stro.at> CommitDate: Thu, 28 Jun 2012 17:28:32 +0200 [klibc] Fix gethostname()/getdomainname() uname(2) returns (like all syscalls) 0 on success. Signed-off-by: Maciej ?enczykowski <maze at google.com> Signed-off-by: maximilian attems <max at stro.at> --- usr/klibc/getdomainname.c | 2 +- usr/klibc/gethostname.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/usr/klibc/getdomainname.c b/usr/klibc/getdomainname.c index 61722ca..218ff0b 100644 --- a/usr/klibc/getdomainname.c +++ b/usr/klibc/getdomainname.c @@ -11,7 +11,7 @@ int getdomainname(char *name, size_t len) { struct utsname un; - if (!uname(&un)) + if (uname(&un)) return -1; if (len < strlen(un.domainname) + 1) { diff --git a/usr/klibc/gethostname.c b/usr/klibc/gethostname.c index 5326b5f..120edd9 100644 --- a/usr/klibc/gethostname.c +++ b/usr/klibc/gethostname.c @@ -11,7 +11,7 @@ int gethostname(char *name, size_t len) { struct utsname un; - if (!uname(&un)) + if (uname(&un)) return -1; if (len < strlen(un.nodename) + 1) {