summaryrefslogtreecommitdiff
path: root/user/oprofile/posixise.patch
blob: dd2ead122d7387c9cad855bfe61dddc7504a88f3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
--- oprofile-1.3.0/libpe_utils/op_pe_utils.cpp.old	2018-07-16 18:58:37.000000000 +0000
+++ oprofile-1.3.0/libpe_utils/op_pe_utils.cpp	2018-10-10 20:20:10.730000000 +0000
@@ -530,7 +530,7 @@
 static string _handle_powerpc_event_spec(string event_spec)
 {
 	FILE * fp;
-	char line[MAX_INPUT];
+	char line[_POSIX_MAX_INPUT];
 	size_t grp_pos;
 	string evt, err_msg;
 	size_t evt_name_len;
@@ -579,7 +579,7 @@
 	}
 
 	err_msg = "Cannot find event ";
-	while (fgets(line, MAX_INPUT, fp)) {
+	while (fgets(line, _POSIX_MAX_INPUT, fp)) {
 		if (!first_non_cyc_evt_found) {
 			if (!strncmp(line, "PM_", 3))
 				first_non_cyc_evt_found = true;
--- oprofile-1.3.0/pe_profiling/operf.cpp.old	2016-08-08 15:03:27.000000000 +0000
+++ oprofile-1.3.0/pe_profiling/operf.cpp	2018-10-10 20:27:23.190000000 +0000
@@ -860,9 +860,9 @@
 {
 	if (remove(fpath)) {
 		perror("sample data removal error");
-		return FTW_STOP;
+		return -1;
 	} else {
-		return FTW_CONTINUE;
+		return 0;
 	}
 }
 
@@ -897,7 +897,7 @@
 		return;
 
 	if (!operf_options::append) {
-                int flags = FTW_DEPTH | FTW_ACTIONRETVAL;
+                int flags = FTW_DEPTH;
 		errno = 0;
 		if (nftw(previous_sampledir.c_str(), __delete_old_previous_sample_data, 32, flags) !=0 &&
 				errno != ENOENT) {