Package: mydumper / 0.5.1-3

0005-zlib-file-type-change-fixes.patch Patch series | download
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
From: Mateusz Kijowski <mkijowski@trojmiasto.pl>
Date: Tue, 6 Mar 2012 16:32:25 +0100
Subject: zlib file type change fixes

---
 binlog.c   |    4 ++--
 mydumper.c |    8 ++++----
 myloader.c |    6 +++---
 3 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/binlog.c b/binlog.c
index e278b6d..0872375 100644
--- a/binlog.c
+++ b/binlog.c
@@ -241,7 +241,7 @@ FILE *new_binlog_file(char *binlog_file, const char *binlog_dir) {
 		outfile= g_fopen(filename, "w");
 	} else {
 		filename= g_strdup_printf("%s/%s.gz", binlog_dir, binlog_file);
-		outfile= gzopen(filename, "w");
+		outfile= (void*) gzopen(filename, "w");
 	}
 	g_free(filename);
 
@@ -252,7 +252,7 @@ void close_binlog_file(FILE *outfile) {
 	if (!compress_output)
 		fclose(outfile);
 	else
-		gzclose(outfile);
+		gzclose((gzFile) outfile);
 }
 
 unsigned int get_event(const char *buf, unsigned int len) {
diff --git a/mydumper.c b/mydumper.c
index 020c245..8216c90 100644
--- a/mydumper.c
+++ b/mydumper.c
@@ -1156,7 +1156,7 @@ void dump_schema_data(MYSQL *conn, char *database, char *table, char *filename)
 	if (!compress_output)
 		outfile= g_fopen(filename, "w");
 	else
-		outfile= gzopen(filename, "w");
+		outfile= (void*) gzopen(filename, "w");
 
 	if (!outfile) {
 		g_critical("Error: DB: %s Could not create output file %s (%d)", database, filename, errno);
@@ -1202,7 +1202,7 @@ void dump_schema_data(MYSQL *conn, char *database, char *table, char *filename)
         if (!compress_output)
                 fclose((FILE *)outfile);
         else
-                gzclose(outfile);
+                gzclose((gzFile)outfile);
 
 
 	g_string_free(statement, TRUE);
@@ -1218,7 +1218,7 @@ void dump_table_data_file(MYSQL *conn, char *database, char *table, char *where,
 	if (!compress_output)
 		outfile = g_fopen(filename, "w");
 	else
-		outfile = gzopen(filename, "w");
+		outfile = (void*) gzopen(filename, "w");
 
 	if (!outfile) {
 		g_critical("Error: DB: %s TABLE: %s Could not create output file %s (%d)", database, table, filename, errno);
@@ -1229,7 +1229,7 @@ void dump_table_data_file(MYSQL *conn, char *database, char *table, char *where,
 	if (!compress_output)
 		fclose((FILE *)outfile);
 	else
-		gzclose(outfile);
+		gzclose((gzFile)outfile);
 
 	if (!rows_count && !build_empty_files) {
 		// dropping the useless file
diff --git a/myloader.c b/myloader.c
index 394154c..2e02f6c 100644
--- a/myloader.c
+++ b/myloader.c
@@ -331,7 +331,7 @@ void restore_data(MYSQL *conn, char *database, char *table, const char *filename
 		infile= g_fopen(path, "r");
 		is_compressed= FALSE;
 	} else {
-		infile= gzopen(path, "r");
+		infile= (void*) gzopen(path, "r");
 		is_compressed= TRUE;
 	}
 
@@ -392,7 +392,7 @@ void restore_data(MYSQL *conn, char *database, char *table, const char *filename
 	if (!is_compressed) {
 		fclose(infile);
 	} else {
-		gzclose(infile);
+		gzclose((gzFile)infile);
 	}	
 	return;
 }
@@ -412,7 +412,7 @@ gboolean read_data(FILE *file, gboolean is_compressed, GString *data, gboolean *
 			}
 		} else {
 			if (!gzgets((gzFile)file, buffer, 256)) {
-				if (gzeof(file)) {
+				if (gzeof((gzFile)file)) {
 					*eof= TRUE;
 					buffer[0]= '\0';
 				} else {