diff options
Diffstat (limited to 'vendor/golang.org/x/sys/unix/xattr_bsd.go')
-rw-r--r-- | vendor/golang.org/x/sys/unix/xattr_bsd.go | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/vendor/golang.org/x/sys/unix/xattr_bsd.go b/vendor/golang.org/x/sys/unix/xattr_bsd.go index 9304993..30c1d71 100644 --- a/vendor/golang.org/x/sys/unix/xattr_bsd.go +++ b/vendor/golang.org/x/sys/unix/xattr_bsd.go | |||
@@ -81,7 +81,10 @@ func Lgetxattr(link string, attr string, dest []byte) (sz int, err error) { | |||
81 | // flags are unused on FreeBSD | 81 | // flags are unused on FreeBSD |
82 | 82 | ||
83 | func Fsetxattr(fd int, attr string, data []byte, flags int) (err error) { | 83 | func Fsetxattr(fd int, attr string, data []byte, flags int) (err error) { |
84 | d := unsafe.Pointer(&data[0]) | 84 | var d unsafe.Pointer |
85 | if len(data) > 0 { | ||
86 | d = unsafe.Pointer(&data[0]) | ||
87 | } | ||
85 | datasiz := len(data) | 88 | datasiz := len(data) |
86 | 89 | ||
87 | nsid, a, err := xattrnamespace(attr) | 90 | nsid, a, err := xattrnamespace(attr) |
@@ -94,7 +97,10 @@ func Fsetxattr(fd int, attr string, data []byte, flags int) (err error) { | |||
94 | } | 97 | } |
95 | 98 | ||
96 | func Setxattr(file string, attr string, data []byte, flags int) (err error) { | 99 | func Setxattr(file string, attr string, data []byte, flags int) (err error) { |
97 | d := unsafe.Pointer(&data[0]) | 100 | var d unsafe.Pointer |
101 | if len(data) > 0 { | ||
102 | d = unsafe.Pointer(&data[0]) | ||
103 | } | ||
98 | datasiz := len(data) | 104 | datasiz := len(data) |
99 | 105 | ||
100 | nsid, a, err := xattrnamespace(attr) | 106 | nsid, a, err := xattrnamespace(attr) |
@@ -107,7 +113,10 @@ func Setxattr(file string, attr string, data []byte, flags int) (err error) { | |||
107 | } | 113 | } |
108 | 114 | ||
109 | func Lsetxattr(link string, attr string, data []byte, flags int) (err error) { | 115 | func Lsetxattr(link string, attr string, data []byte, flags int) (err error) { |
110 | d := unsafe.Pointer(&data[0]) | 116 | var d unsafe.Pointer |
117 | if len(data) > 0 { | ||
118 | d = unsafe.Pointer(&data[0]) | ||
119 | } | ||
111 | datasiz := len(data) | 120 | datasiz := len(data) |
112 | 121 | ||
113 | nsid, a, err := xattrnamespace(attr) | 122 | nsid, a, err := xattrnamespace(attr) |