Comment 2 for bug 591968

Revision history for this message
John Rigby (jcrigby) wrote :

On careful inspection of the armel strace output we can
see that the result buffer of the first readlink result has
extra non null garbage after the 17 bytes copied in by
readlink:

readlink("test-linkat.tlink1", "test-linkat.tsub1"..., 1025) = 17
readlink("test-linkat.tlink5", "test-linkat.tsub1", 1025) = 17

so the strcmp in check_same_link in test-linkat.c fails

this is to be expected because the readlink man page says:
readlink() places the contents of the symbolic link path in the
buffer buf, which has size bufsiz. readlink() does not append a
null byte to buf.

So the test needs to add the null termination or the areadlink_with_size
library routine in lib/areadlink-with-size.c needs to.