Skip to content
Browse files

Return ENOENT if a file doesn't exist for readlink.

Reported by Anders Kaseorg <andersk@mit.edu>
  • Loading branch information...
1 parent 077ffad commit 913edd40e5ffdd2a096d8d65ec3bfeb43078b795 @ebroder committed Sep 1, 2008
Showing with 3 additions and 1 deletion.
  1. +3 −1 routefs/__init__.py
View
4 routefs/__init__.py
@@ -148,7 +148,9 @@ def readlink(self, path):
If the path specified is a symlink, return the target
"""
obj = self._get_file(path)
- if type(obj) is not Symlink:
+ if obj is None:
+ return -errno.ENOENT
+ elif type(obj) is not Symlink:
return -errno.EINVAL
else:
return obj

0 comments on commit 913edd4

Please sign in to comment.
Something went wrong with that request. Please try again.