Skip to contentSkip to conversation

/vm/hugepage/thp/thp05: cleanup should not use safe macros

PATCH Cyril Hrubis 1 participant 1 message Dec 16, 2014 2 messages not in the archive

lore
Share & tools
lore
#2 lore raw
In reply to a message not in the archive

Hi!
Rebased and pushed with a few cosmetic changes (see below), thanks.

Review

Quoted 12 lines
(quoted diff) +12 -0
+int file_scanf(const char *file, const int lineno,
+		     const char *path, const char *fmt, ...)
+{
+	va_list va;
+	FILE *f;
+	int exp_convs, ret;
+
+	f = fopen(path, "r");
+
+	if (f == NULL) {
+		tst_resm(TWARN,
+			"Failed to close FILE '%s' at %s:%d",
                                   ^
				   open
Quoted 4 lines
(quoted diff) +4 -0
+			 path, file, lineno);
+		return 1;
+	}
+

...

Quoted 5 lines
(quoted diff) +5 -0
+	if (fclose(f)) {
+		tst_resm(TWARN,
+			 "Failed to close FILE '%s' at %s:%d",
+			 path, file, lineno);
+		return 1;

Review

Quoted 10 lines
(quoted diff) +10 -0
+	}
+
+	return 0;
+
+err:
+	if (fclose(f)) {
+		tst_resm(TWARN,
+			 "Failed to close FILE '%s' at %s:%d",
+			 path, file, lineno);
+		return 1;

^
This is not needed because of the return 1 right below.

Quoted 3 lines
(quoted diff) +3 -0
+	}
+	return 1;
+}
Signature · 13 lines
Cyril Hrubis
[email protected]

------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list