index a38c262c3febeba6715b884245d343e15acb92c3..ea933233d2f8bf9e21611a761b0ecc4a7f20e35f 100644 (file)
static void
mock_conn_truncate(sdb_conn_t *conn)
{
+ int status;
lseek(conn->fd, 0, SEEK_SET);
- ftruncate(conn->fd, 0);
+ status = ftruncate(conn->fd, 0);
+ fail_unless(status == 0,
+ "INTERNAL ERROR: ftruncate(%d, 0) = %d; expected: 0",
+ conn->fd, status);
} /* mock_conn_truncate */
static int
fail_unless(conn == NULL,
"sdb_connection_accept(-1) = %p; expected: NULL", conn);
- mkstemp(socket_path);
+ fd = mkstemp(socket_path);
unlink(socket_path);
+ close(fd);
fd = mock_unixsock_listener(socket_path);
check = pthread_create(&thr, /* attr = */ NULL, mock_client, socket_path);