diff options
author | Elliott Hughes <enh@google.com> | 2014-10-24 23:30:58 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2014-10-24 23:30:59 +0000 |
commit | 05a66cd9164dda93625cb1f8b9b082f94d124a5d (patch) | |
tree | 29d3ccd91878cc4b924157262a4bef6e108c268f | |
parent | 27443f28bbcbc6aca7b6b3fda54a177779929af1 (diff) | |
parent | a38def7e8f366ba3e045b4c3a019a86d3e1a598d (diff) | |
download | extras-05a66cd9164dda93625cb1f8b9b082f94d124a5d.tar.gz |
Merge "bionic libs test: clean up for gethostname test"
-rw-r--r-- | tests/bionic/libc/Android.mk | 1 | ||||
-rw-r--r-- | tests/bionic/libc/common/test_gethostname.c | 47 |
2 files changed, 0 insertions, 48 deletions
diff --git a/tests/bionic/libc/Android.mk b/tests/bionic/libc/Android.mk index bdfe92d5..85ee9050 100644 --- a/tests/bionic/libc/Android.mk +++ b/tests/bionic/libc/Android.mk @@ -61,7 +61,6 @@ endef # First, the tests in 'common' sources := \ - common/test_gethostname.c \ common/test_pthread_mutex.c \ common/test_pthread_rwlock.c \ common/test_pthread_once.c \ diff --git a/tests/bionic/libc/common/test_gethostname.c b/tests/bionic/libc/common/test_gethostname.c deleted file mode 100644 index 96ca4e32..00000000 --- a/tests/bionic/libc/common/test_gethostname.c +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (C) 2008 The Android Open Source Project - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS - * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED - * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ -#include <unistd.h> -#include <errno.h> -#include <string.h> -#include <stdio.h> -#include <sys/types.h> - -int main( void ) -{ - char hostname[512]; - int ret; - - ret = gethostname(hostname, sizeof(hostname)); - if (ret < 0) { - printf("gethostname() returned error %d: %s\n", errno, strerror(errno)); - return 1; - } - - printf("gethostname() returned '%s'\n", hostname); - return 0; -} |