Changes by: antona
Update of /cvsroot/linux-ntfs/linux-ntfs/ntfstools
In directory usw-pr-cvs1:/tmp/cvs-serv22057/ntfstools
Modified Files:
ntfsfix.c
Log Message:
Cleanups and updates.
Index: ntfsfix.c
===================================================================
RCS file: /cvsroot/linux-ntfs/linux-ntfs/ntfstools/ntfsfix.c,v
retrieving revision 1.22
retrieving revision 1.23
diff -U2 -r1.22 -r1.23
--- ntfsfix.c 12 Mar 2002 22:11:02 -0000 1.22
+++ ntfsfix.c 14 Apr 2002 14:15:47 -0000 1.23
@@ -77,5 +77,5 @@
ntfs_volume *vol = NULL;
__u16 flags;
- attr_search_context ctx;
+ attr_search_context *ctx = NULL;
MFT_REF mref;
@@ -343,7 +343,11 @@
printf("Going to empty the journal ($LogFile)... ");
/* Find the $DATA attribute. */
- memset(&ctx, 0, sizeof(attr_search_context));
- ctx.mrec = (MFT_RECORD*)(b1 + (2 * mrs));
- if (!find_first_attr($DATA, NULL, 0, 0, NULL, 0, NULL, 0, &ctx)) {
+ ctx = get_attr_search_ctx(NULL, (MFT_RECORD*)(b1 + (2 * mrs)));
+ if (!ctx) {
+ puts(FAILED);
+ perror("Failed to allocate attribute search context");
+ goto log_file_error;
+ }
+ if (!find_attr($DATA, NULL, 0, 0, NULL, 0, NULL, 0, ctx)) {
puts(FAILED);
fprintf(stderr, "Error: Attribute $DATA was not found in" \
@@ -351,5 +355,5 @@
goto log_file_error;
}
- a = ctx.attr;
+ a = ctx->attr;
/* The $DATA attribute of the $LogFile has to be non-resident. */
if (!a->non_resident) {
@@ -426,4 +430,6 @@
i = 0;
final_exit:
+ if (ctx)
+ put_attr_search_ctx(ctx);
if (b1)
free(b1);
|