make it add attribute if it's not present

(Logical change 1.612)
edge.strict_endians
(none)!yura 2004-10-14 18:23:21 +00:00
parent a3e26fc943
commit f548a3a600
1 changed files with 12 additions and 2 deletions

View File

@ -312,8 +312,18 @@ int main (int argc, char *argv[])
}
na = ntfs_attr_open(out, opts.attribute, attr_name, attr_name_len);
if (!na) {
perror("ERROR: Couldn't open attribute");
goto close_dst;
if (errno != ENOENT) {
perror("ERROR: Couldn't open attribute");
goto close_dst;
}
/* Requested attribute isn't present, add it. */
na = ntfs_inode_add_attr(out, opts.attribute, attr_name,
attr_name_len, 0);
if (!na) {
perror("ERROR: Couldn't add attribute");
goto close_dst;
}
need_logfile_reset = 1;
}
Vprintf("Old file size: %lld\n", na->data_size);