Skip to content

Commit 696190c

Browse files
committed
some printf
1 parent 063b075 commit 696190c

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/odbc/unittests/timeout3.c

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ static TDS_THREAD_PROC_DECLARE(fake_thread_proc, arg)
9999
perror("accept");
100100
exit(1);
101101
}
102+
printf("Got connection\n");
102103
tds_mutex_lock(&mtx);
103104
fake_sock = sock;
104105
tds_mutex_unlock(&mtx);
@@ -111,16 +112,20 @@ static TDS_THREAD_PROC_DECLARE(fake_thread_proc, arg)
111112
fd.events = POLLIN;
112113
fd.revents = 0;
113114
if (poll(&fd, 1, 30000) <= 0) {
114-
fprintf(stderr, "poll: %d\n", sock_errno);
115+
fprintf(stderr, "XXX poll: %d\n", sock_errno);
115116
exit(1);
116117
}
117118

118119
/* just read and discard */
119120
len = READSOCKET(sock, buf, sizeof(buf));
120-
if (len == 0)
121+
if (len == 0) {
122+
printf("No data\n");
121123
break;
122-
if (len < 0 && sock_errno != TDSSOCK_EINPROGRESS)
124+
}
125+
if (len < 0 && sock_errno != TDSSOCK_EINPROGRESS) {
126+
printf("Read error %d\n", sock_errno);
123127
break;
128+
}
124129
}
125130
return TDS_THREAD_RESULT(0);
126131
}
@@ -194,6 +199,7 @@ main(void)
194199
odbc_disconnect();
195200
tds_thread_join(fake_thread, NULL);
196201
tds_mutex_lock(&mtx);
202+
printf("Closing socket\n");
197203
CLOSESOCKET(fake_sock);
198204
tds_mutex_unlock(&mtx);
199205

0 commit comments

Comments
 (0)