Maciej Żenczykowski
2012-Jun-28 01:07 UTC
[klibc] [PATCH] klibc: fix gethostname()/getdomainname()
From: Maciej ?enczykowski <maze at google.com> uname(2) returns (like all syscalls) 0 on success. Signed-off-by: Maciej ?enczykowski <maze at google.com> --- 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 61722ca3519b..218ff0baa871 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 5326b5fc4eb9..120edd943170 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) { -- 1.7.9.4
maximilian attems
2012-Jun-28 15:29 UTC
[klibc] [PATCH] klibc: fix gethostname()/getdomainname()
On Wed, 27 Jun 2012, Maciej ?enczykowski wrote:> From: Maciej ?enczykowski <maze at google.com> > > uname(2) returns (like all syscalls) 0 on success. > > Signed-off-by: Maciej ?enczykowski <maze at google.com> > --- > usr/klibc/getdomainname.c | 2 +- > usr/klibc/gethostname.c | 2 +- > 2 files changed, 2 insertions(+), 2 deletions(-)Thank you, applied and pushed. -- maks