fix readlink error on Mac.

Signed-off-by: Bao Haojun <baohaojun@gmail.com>