OSX: fix readlink call
Merge pull request #1926 from mehlis/fix-readlink

OSX: fix readlink call