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:
parent
48d046ac05
commit
d668899063
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user