r4152 - trunk/varnish-cache/bin/varnishreplay
tfheen at projects.linpro.no
tfheen at projects.linpro.no
Tue Jul 28 15:54:39 CEST 2009
Author: tfheen
Date: 2009-07-28 15:54:39 +0200 (Tue, 28 Jul 2009)
New Revision: 4152
Modified:
trunk/varnish-cache/bin/varnishreplay/varnishreplay.c
Log:
Rename struct thread to struct replay_thread in varnishreplay
AIX has a "struct thread" in pthread.h, which conflicts with our
struct thread. Rename ours to replay_thread.
Fixes #531
Thanks to demik for patch
Modified: trunk/varnish-cache/bin/varnishreplay/varnishreplay.c
===================================================================
--- trunk/varnish-cache/bin/varnishreplay/varnishreplay.c 2009-07-28 13:54:36 UTC (rev 4151)
+++ trunk/varnish-cache/bin/varnishreplay/varnishreplay.c 2009-07-28 13:54:39 UTC (rev 4152)
@@ -191,7 +191,7 @@
pthread_mutex_unlock(&log_mutex);
}
-struct thread {
+struct replay_thread {
pthread_t thread_id;
struct mailbox mbox;
@@ -213,14 +213,14 @@
char temp[2048];
};
-static struct thread **threads;
+static struct replay_thread **threads;
static size_t nthreads;
/*
* Clear thread state
*/
static void
-thread_clear(struct thread *thr)
+thread_clear(struct replay_thread *thr)
{
thr->method = thr->proto = thr->url = NULL;
@@ -237,17 +237,17 @@
thr->sock = -1;
}
-#define THREAD_FAIL ((struct thread *)-1)
+#define THREAD_FAIL ((struct replay_thread *)-1)
static pthread_attr_t thread_attr;
-static struct thread *
+static struct replay_thread *
thread_get(int fd, void *(*thread_main)(void *))
{
assert(fd != 0);
if (fd >= nthreads) {
- struct thread **newthreads = threads;
+ struct replay_thread **newthreads = threads;
size_t newnthreads = nthreads;
while (fd >= newnthreads)
@@ -310,7 +310,7 @@
* Allocate from thread arena
*/
static void *
-thread_alloc(struct thread *thr, size_t len)
+thread_alloc(struct replay_thread *thr, size_t len)
{
void *ptr;
@@ -326,7 +326,7 @@
* trimmed.
*/
static char *
-trimline(struct thread *thr, const char *str)
+trimline(struct replay_thread *thr, const char *str)
{
size_t len;
char *p;
@@ -356,7 +356,7 @@
* A line is terminated by \r\n
*/
static int
-read_line(struct thread *thr)
+read_line(struct replay_thread *thr)
{
int i, len;
@@ -390,7 +390,7 @@
* the number of bytes read.
*/
static int
-read_block(struct thread *thr, int len)
+read_block(struct replay_thread *thr, int len)
{
int n, r, tot;
@@ -413,7 +413,7 @@
/* Receive the response after sending a request.
*/
static int
-receive_response(struct thread *thr)
+receive_response(struct replay_thread *thr)
{
const char *next;
int line_len;
@@ -497,7 +497,7 @@
{
struct iovec iov[6];
char space[1] = " ", crlf[2] = "\r\n";
- struct thread *thr = arg;
+ struct replay_thread *thr = arg;
struct message *msg;
enum shmlogtag tag;
size_t len;
@@ -643,7 +643,7 @@
gen_traffic(void *priv, enum shmlogtag tag, unsigned fd,
unsigned len, unsigned spec, const char *ptr)
{
- struct thread *thr;
+ struct replay_thread *thr;
const char *end;
struct message *msg;
More information about the varnish-commit
mailing list