platform_bionic/libc/unistd
David 'Digit' Turner d378c68d74 Fix spurious DNS lookups in the C library.
The problem was that the 'defdname' field of res_state structure
was not properly initialized in __res_vinit(). This field is used
to store the default domain name, which is normally build from
calling gethostname() (see line 549 of res_init.c).

Unfortunately, in the typical Android case, gethostname() returns
an error (the hostname is configured) and a random stack string is
used later to build the DNS search list (see lines 556+ in res_init.c)

For the sake of illustration, let's say the search list is set to
a random value like 'xWLK'.

The end result is that when trying to result an unknown domain name
(e.g. 'www.ptn'), the query fails then the resolver tries to make a
new query with the DNS search list path(s) appended (e.g. 'www.ptn.xWLK').

The patch simply initializes 'defdname' to an empty string to avoid
this when the net.dns.search system property is not set.

Also contains whitespace/formatting fixes
2010-03-08 15:22:13 -08:00
..
abort.c Wrap ARM abort() to improve stack trace. 2009-10-15 16:29:22 -07:00
alarm.c auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
brk.c auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
creat.c auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
daemon.c auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
exec.c auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
fcntl.c auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
fnmatch.c auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
ftime.c auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
ftok.c auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
getcwd.c auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
getdtablesize.c auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
gethostname.c Fix spurious DNS lookups in the C library. 2010-03-08 15:22:13 -08:00
getopt_long.c auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
getpgrp.c auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
getpriority.c auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
getpt.c auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
initgroups.c auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
isatty.c auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
issetugid.c auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
killpg.c Add killpg function 2010-01-15 16:27:04 -08:00
lseek64.c auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
mmap.c auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
nice.c auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
open.c auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
openat.c auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
opendir.c auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
pathconf.c auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
perror.c auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
popen.c auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
pread.c auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
pselect.c auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
ptsname.c auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
ptsname_r.c Fix ptsname_r(3) return type to match glibc 2010-01-12 12:58:12 -08:00
pwrite.c auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
raise.c auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
reboot.c auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
recv.c auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
sbrk.c auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
send.c auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
setegid.c auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
seteuid.c bonic: libc: cpuacct support for setuid functions 2010-03-02 18:18:04 -08:00
setpgrp.c auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
setresuid.c bonic: libc: cpuacct support for setuid functions 2010-03-02 18:18:04 -08:00
setreuid.c bonic: libc: cpuacct support for setuid functions 2010-03-02 18:18:04 -08:00
setuid.c bonic: libc: cpuacct support for setuid functions 2010-03-02 18:18:04 -08:00
sigblock.c auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
siginterrupt.c auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
siglist.c Add the BSD sys_signame array. 2009-11-05 15:50:05 -08:00
signal.c auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
signame.c Add the BSD sys_signame array. 2009-11-05 15:50:05 -08:00
sigsetmask.c auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
sigsuspend.c auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
sigwait.c auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
sleep.c auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
socketcalls.c added syscalls for SuperH which automatically generate by gensyscalls.py 2009-07-01 15:35:27 +09:00
statfs.c auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
strsignal.c auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
sysconf.c auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
syslog.c auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
system.c auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
tcgetpgrp.c auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
tcsetpgrp.c auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
time.c auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
umount.c auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
unlockpt.c auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
usleep.c Fix usleep(3) return type to be POSIX-compliant. 2009-12-14 17:07:19 -08:00
wait.c auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00