On success readlink() returns the number of bytes read, not 0.

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8706 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold 2004-08-29 11:59:07 +00:00
parent 48d046ac05
commit d668899063

View File

@ -61,7 +61,7 @@ display_l(const char *path, const char *filename, struct stat *stat)
if (S_ISLNK(stat->st_mode)) {
char buffer[1024];
if (readlink(path, buffer, sizeof(buffer)) != 0)
if (readlink(path, buffer, sizeof(buffer)) < 0)
strcpy(buffer, "???");
printf(" (-> %s)\n", buffer);
} else