summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Watson <rwatson@FreeBSD.org>2000-09-07 20:32:31 +0000
committerRobert Watson <rwatson@FreeBSD.org>2000-09-07 20:32:31 +0000
commit6af962184194a5e93dae09ebb93c103f0b213e0c (patch)
tree80c29978b693cb6077665544c867389e0b67d27b
parente11a1ee8706852bd0a614b6731a4e0d175a006b4 (diff)
Notes
-rw-r--r--usr.sbin/extattrctl/extattrctl.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/usr.sbin/extattrctl/extattrctl.c b/usr.sbin/extattrctl/extattrctl.c
index c5c250855197..7d34831f007c 100644
--- a/usr.sbin/extattrctl/extattrctl.c
+++ b/usr.sbin/extattrctl/extattrctl.c
@@ -82,7 +82,7 @@ initattr(int argc, char *argv[])
char *fs_path = NULL;
char *zero_buf = NULL;
long loop, num_inodes;
- int ch, i, error;
+ int ch, i, error, chunksize;
optind = 0;
while ((ch = getopt(argc, argv, "p:r:w:")) != -1)
@@ -117,9 +117,11 @@ initattr(int argc, char *argv[])
}
memset(zero_buf, 0, uef.uef_size);
num_inodes = num_inodes_by_path(fs_path);
+ chunksize = sizeof(struct ufs_extattr_header) +
+ uef.uef_size;
for (loop = 0; loop < num_inodes; loop++) {
- error = write(i, zero_buf, uef.uef_size);
- if (error != uef.uef_size) {
+ error = write(i, zero_buf, chunksize);
+ if (error != chunksize) {
perror("write");
unlink(argv[1]);
return (-1);