Index: trunk/tools/trainwreck/trainwreck.c |
— | — | @@ -459,9 +459,8 @@ |
460 | 460 | { |
461 | 461 | set_thread_name("reader"); |
462 | 462 | |
463 | | - logmsg("waiting for writers to become ready..."); |
464 | | - |
465 | 463 | (void) pthread_mutex_lock(&wi_mtx); |
| 464 | + logmsg("waiting for %d writers to become ready...", writers_initialising); |
466 | 465 | while (writers_initialising > 0) |
467 | 466 | (void) pthread_cond_wait(&wi_cond, &wi_mtx); |
468 | 467 | (void) pthread_mutex_unlock(&wi_mtx); |
— | — | @@ -881,7 +880,6 @@ |
882 | 881 | |
883 | 882 | writers_initialising = nwriters; |
884 | 883 | (void) pthread_mutex_unlock(&wst_mtx); |
885 | | - |
886 | 884 | |
887 | 885 | for (i = 0; i < nwriters; ++i) { |
888 | 886 | (void) pthread_create(&writers[i].wr_thread, NULL, slave_write_thread, &writers[i]); |
— | — | @@ -926,8 +924,8 @@ |
927 | 925 | } |
928 | 926 | |
929 | 927 | if (retrieve_binlog_position(self) != 0) { |
930 | | - logmsg("could not retrieve binlog position"); |
931 | | - return 0; |
| 928 | + logmsg("could not retrieve binlog position; trying to continue anyway"); |
| 929 | + /*return 0;*/ |
932 | 930 | } |
933 | 931 | |
934 | 932 | (void) pthread_mutex_lock(&wi_mtx); |
— | — | @@ -1032,7 +1030,7 @@ |
1033 | 1031 | do_ignore_errno(n) |
1034 | 1032 | unsigned n; |
1035 | 1033 | { |
1036 | | - ignorable_errno = realloc(ignorable_errno, nignorable + 1); |
| 1034 | + ignorable_errno = realloc(ignorable_errno, sizeof(int) * (nignorable + 1)); |
1037 | 1035 | ignorable_errno[nignorable] = n; |
1038 | 1036 | nignorable++; |
1039 | 1037 | } |
— | — | @@ -1115,6 +1113,7 @@ |
1116 | 1114 | writer_t *writer; |
1117 | 1115 | { |
1118 | 1116 | int rstat; |
| 1117 | +ssize_t n; |
1119 | 1118 | struct stat st; |
1120 | 1119 | char *buf; |
1121 | 1120 | char sname[128]; |
— | — | @@ -1143,7 +1142,7 @@ |
1144 | 1143 | } |
1145 | 1144 | |
1146 | 1145 | buf = calloc(1, st.st_size + 1); |
1147 | | - if (read(rstat, buf, st.st_size) != st.st_size) { |
| 1146 | + if ((n = read(rstat, buf, st.st_size)) != st.st_size) { |
1148 | 1147 | logmsg("short read on state file \"%s\": %s", |
1149 | 1148 | sname, strerror(errno)); |
1150 | 1149 | exit(1); |
Index: trunk/tools/trainwreck/Makefile |
— | — | @@ -1,9 +1,13 @@ |
2 | | -CC = gcc |
3 | | -#CFLAGS = -g -mt -m64 -xc99=none |
4 | | -CFLAGS = -g -D_REENTRANT -m64 |
| 2 | +#CC = gcc |
| 3 | +CC = cc |
| 4 | +CFLAGS = -g -mt -xc99=none -D_FILE_OFFSET_BITS=64 |
| 5 | +#CFLAGS = -g -D_REENTRANT -m64 -DBIG_TABLES -DHAVE_RWLOCK_T |
| 6 | +#CFLAGS = -g -D_REENTRANT -D_FILE_OFFSET_BITS=64 |
5 | 7 | LDFLAGS = |
6 | 8 | MYSQL_CFLAGS:sh = mysql_config --include |
7 | | -MYSQL_LIBS:sh = mysql_config --libs_r |
| 9 | +#MYSQL_LIBS:sh = mysql_config --libs_r |
| 10 | +#MYSQL_LIBS = -L/usr/local/mysql/lib/mysql -R/usr/local/mysql/lib/mysql -lmysqlclient |
| 11 | +MYSQL_LIBS = -L/opt/mysql/lib/mysql -R/opt/mysql/lib/mysql -lmysqlclient |
8 | 12 | INCLUDES = |
9 | 13 | LIBS = -lrt -ldoor |
10 | 14 | PROG = trainwreck |