Update userland tools to reflect extattr API changes.

Note that getextattr has not yet been updated to dynamically allocate
a read buffer, although that can now be done.

Obtained from:	TrustedBSD Project
Sponsored by:	NAI Labs
This commit is contained in:
Robert Watson 2002-02-10 04:48:26 +00:00
parent c0858e0a77
commit f01dde98e3
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=90451
2 changed files with 8 additions and 10 deletions

View File

@ -54,7 +54,6 @@ usage(void)
int
main(int argc, char *argv[])
{
struct iovec iov_buf;
char *attrname;
char buf[BUFSIZE];
char visbuf[BUFSIZE*4];
@ -93,12 +92,14 @@ main(int argc, char *argv[])
argc--;
argv++;
iov_buf.iov_base = buf;
iov_buf.iov_len = BUFSIZE;
/*
* XXX: Note: now that EAs support querying the size, we could
* actually allocate a buffer of the right size, rather than
* truncating at BUFSIZE.
*/
for (arg_counter = 1; arg_counter < argc; arg_counter++) {
error = extattr_get_file(argv[arg_counter], attrnamespace,
attrname, &iov_buf, 1);
attrname, buf, BUFSIZE);
if (error == -1)
perror(argv[arg_counter]);

View File

@ -52,7 +52,6 @@ usage(void)
int
main(int argc, char *argv[])
{
struct iovec iov_buf;
int error, attrnamespace;
if (argc != 5)
@ -64,10 +63,8 @@ main(int argc, char *argv[])
return (-1);
}
iov_buf.iov_base = argv[4];
iov_buf.iov_len = strlen(argv[4]);
error = extattr_set_file(argv[3], attrnamespace, argv[2], &iov_buf, 1);
error = extattr_set_file(argv[3], attrnamespace, argv[2], argv[4],
strlen(argv[4]));
if (error == -1) {
perror(argv[3]);
return (-1);