diff --git a/libc/Makefile b/libc/Makefile index 2de5c8af..e528be6e 100644 --- a/libc/Makefile +++ b/libc/Makefile @@ -671,7 +671,6 @@ unistd/fsync.o \ unistd/ftruncate.o \ unistd/get_current_dir_name.o \ unistd/getcwd.o \ -unistd/getdomainname.o \ unistd/getegid.o \ unistd/getentropy.o \ unistd/geteuid.o \ diff --git a/libc/include/sys/utsname.h b/libc/include/sys/utsname.h index 50c8c79d..e7669101 100644 --- a/libc/include/sys/utsname.h +++ b/libc/include/sys/utsname.h @@ -39,7 +39,6 @@ struct utsname char processor[_UTSNAME_LENGTH]; char hwplatform[_UTSNAME_LENGTH]; char opsysname[_UTSNAME_LENGTH]; - char domainname[_UTSNAME_LENGTH]; }; int uname(struct utsname*); diff --git a/libc/include/unistd.h b/libc/include/unistd.h index 185c6626..44352326 100644 --- a/libc/include/unistd.h +++ b/libc/include/unistd.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2012, 2013, 2014, 2015 Jonas 'Sortie' Termansen. + * Copyright (c) 2011, 2012, 2013, 2014, 2015, 2016 Jonas 'Sortie' Termansen. * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -548,7 +548,6 @@ int crypt_newhash(const char*, const char*, char*, size_t); int dup3(int, int, int); int execvpe(const char*, char* const [], char* const []); char* get_current_dir_name(void); -int getdomainname(char*, size_t); int getentropy(void*, size_t); int pipe2(int [2], int); int sethostname(const char*, size_t); diff --git a/libc/sys/utsname/uname.c b/libc/sys/utsname/uname.c index 2c62d596..54030504 100644 --- a/libc/sys/utsname/uname.c +++ b/libc/sys/utsname/uname.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015 Jonas 'Sortie' Termansen. + * Copyright (c) 2014, 2015, 2016 Jonas 'Sortie' Termansen. * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -63,7 +63,5 @@ int uname(struct utsname* name) strlcpy(name->processor, processor, sizeof(name->processor)); strlcpy(name->hwplatform, hwplatform, sizeof(name->hwplatform)); strlcpy(name->opsysname, opsysname, sizeof(name->opsysname)); - if ( getdomainname(name->domainname, sizeof(name->domainname)) < 0 ) - strlcpy(name->domainname, "unknown", sizeof(name->domainname)); return 0; } diff --git a/libc/unistd/getdomainname.c b/libc/unistd/getdomainname.c deleted file mode 100644 index 99feb3e3..00000000 --- a/libc/unistd/getdomainname.c +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) 2014 Jonas 'Sortie' Termansen. - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * - * unistd/getdomainname.c - * Get the domainname. - */ - -#include -#include -#include -#include - -int getdomainname(char* name, size_t len) -{ - const char* domainname = getenv("DOMAINNAME"); - if ( !domainname ) - domainname = "localdomain"; - size_t domainname_len = strlen(domainname); - if ( len < domainname_len+1 ) - return errno = ENAMETOOLONG, -1; - strcpy(name, domainname); - return 0; -}