FreeBSD Bugzilla – Attachment 161184 Details for
Bug 203201
on zfs extattr behaviour broken after unlink
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
test case when attribute exists
xattr3.c (text/plain), 853 bytes, created by
justin
on 2015-09-19 09:56:37 UTC
(
hide
)
Description:
test case when attribute exists
Filename:
MIME Type:
Creator:
justin
Created:
2015-09-19 09:56:37 UTC
Size:
853 bytes
patch
obsolete
>#include <fcntl.h> >#include <stdio.h> >#include <unistd.h> >#include <errno.h> >#include <sys/types.h> >#include <sys/extattr.h> > >int main() { > int fd; > ssize_t n; > > unlink("testfile"); > fd = open("testfile", O_CREAT | O_TRUNC | O_WRONLY, 0600); > if (fd == -1) { > perror("open"); > return 1; > } > n = extattr_set_fd(fd, EXTATTR_NAMESPACE_USER, "myattr", "banana", 6); > if (n == -1) { > perror("extattr_set_fd"); > return 1; > } > if (unlink("testfile") == -1) { > perror("unlink"); > return 1; > } > n = extattr_get_fd(fd, EXTATTR_NAMESPACE_USER, "myattr", NULL, 0); > if (n == -1 && errno == EOPNOTSUPP) { > fprintf(stderr, "extended attributes not supported, this test will not work\n"); > return 0; > } > if (n == -1) { > fprintf(stderr, "INCORRECT! got error but attr set\n"); > return 1; > } > fprintf(stderr, "CORRECT! there is no attribute\n"); > return 0; >} >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 203201
:
161182
|
161183
| 161184