aboutsummaryrefslogtreecommitdiff
path: root/internal/syscallcompat/open_nofollow_test.go
diff options
context:
space:
mode:
authorJakob Unterwurzacher2017-12-05 23:08:55 +0100
committerJakob Unterwurzacher2017-12-05 23:08:55 +0100
commite604ce6deaf0ba4407c54293a338673ed06f833a (patch)
tree27528c7cf4a7fad800522b86f5e7ffacab2953dd /internal/syscallcompat/open_nofollow_test.go
parent47b13e0a8d5d1e1312ba3fb70af318a0002780bf (diff)
syscallcompat: OpenNofollow: fix relPath="" case
Sometimes want to open baseDir itself. This case was broken, fix it.
Diffstat (limited to 'internal/syscallcompat/open_nofollow_test.go')
-rw-r--r--internal/syscallcompat/open_nofollow_test.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/internal/syscallcompat/open_nofollow_test.go b/internal/syscallcompat/open_nofollow_test.go
index e9cdf77..37ea76b 100644
--- a/internal/syscallcompat/open_nofollow_test.go
+++ b/internal/syscallcompat/open_nofollow_test.go
@@ -34,4 +34,11 @@ func TestOpenNofollow(t *testing.T) {
if err != syscall.ELOOP {
t.Errorf("expected ELOOP, got %v", err)
}
+ // Check to see that the base dir can be opened as well
+ fd, err = OpenNofollow(tmpDir, "", syscall.O_RDONLY, 0)
+ if err != nil {
+ t.Errorf("cannot open base dir: %v", err)
+ } else {
+ syscall.Close(fd)
+ }
}