Changes by: cha0smaster
Update of /cvsroot/linux-ntfs/ntfsprogs/ntfsprogs
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26027/ntfsprogs
Modified Files:
ntfscp.c ntfsmount.c
Log Message:
Fix resident attribute adding: Add @val to ntfs_attr_add and @val and @size to ntfs_resident_attr_record_add.
Still need to fix attribute lis entry adding. :-(
Index: ntfscp.c
===================================================================
RCS file: /cvsroot/linux-ntfs/ntfsprogs/ntfsprogs/ntfscp.c,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -p -r1.25 -r1.26
--- ntfscp.c 25 Jul 2005 22:05:27 -0000 1.25
+++ ntfscp.c 16 Sep 2005 14:28:18 -0000 1.26
@@ -378,12 +378,17 @@ int main (int argc, char *argv[])
goto close_dst;
}
/* Requested attribute isn't present, add it. */
- na = ntfs_attr_add(out, opts.attribute, attr_name,
- attr_name_len, 0);
- if (!na) {
+ if (ntfs_attr_add(out, opts.attribute, attr_name,
+ attr_name_len, NULL, 0)) {
perror("ERROR: Couldn't add attribute");
goto close_dst;
}
+ na = ntfs_attr_open(out, opts.attribute, attr_name,
+ attr_name_len);
+ if (!na) {
+ perror("ERROR: Couldn't open just added attribute");
+ goto close_dst;
+ }
}
if (attr_name != AT_UNNAMED)
free(attr_name);
Index: ntfsmount.c
===================================================================
RCS file: /cvsroot/linux-ntfs/ntfsprogs/ntfsprogs/ntfsmount.c,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -p -r1.27 -r1.28
--- ntfsmount.c 31 Aug 2005 14:31:53 -0000 1.27
+++ ntfsmount.c 16 Sep 2005 14:28:18 -0000 1.28
@@ -578,7 +578,6 @@ static int ntfs_fuse_create_stream(const
ntfschar *stream_name, const int stream_name_len)
{
ntfs_inode *ni;
- ntfs_attr *na;
int res = 0;
ni = ntfs_pathname_to_inode(ctx->vol, NULL, path);
@@ -598,10 +597,7 @@ static int ntfs_fuse_create_stream(const
}
return res;
}
- na = ntfs_attr_add(ni, AT_DATA, stream_name, stream_name_len, 0);
- if (na)
- ntfs_attr_close(na);
- else
+ if (ntfs_attr_add(ni, AT_DATA, stream_name, stream_name_len, NULL, 0))
res = -errno;
if (ntfs_inode_close(ni))
perror("Failed to close inode");
|