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:
@@ -61,7 +61,7 @@ display_l(const char *path, const char *filename, struct stat *stat)
|
|||||||
|
|
||||||
if (S_ISLNK(stat->st_mode)) {
|
if (S_ISLNK(stat->st_mode)) {
|
||||||
char buffer[1024];
|
char buffer[1024];
|
||||||
if (readlink(path, buffer, sizeof(buffer)) != 0)
|
if (readlink(path, buffer, sizeof(buffer)) < 0)
|
||||||
strcpy(buffer, "???");
|
strcpy(buffer, "???");
|
||||||
printf(" (-> %s)\n", buffer);
|
printf(" (-> %s)\n", buffer);
|
||||||
} else
|
} else
|
||||||
|
|||||||
Reference in New Issue
Block a user