summaryrefslogtreecommitdiff
path: root/examples/network
diff options
context:
space:
mode:
authorChris Young <chris@unsatisfactorysoftware.co.uk>2012-06-14 18:57:24 +0100
committerChris Young <chris@unsatisfactorysoftware.co.uk>2012-06-14 18:57:24 +0100
commita8df98c6fb07b8ddff18a01d7f2f607d9493dd7c (patch)
tree508aa2bdd6278e967ce4122c37a6a7d9a77bdad5 /examples/network
parenta21bb1aa33e9887c06852db62526895df6091736 (diff)
downloadlibgit2-a8df98c6fb07b8ddff18a01d7f2f607d9493dd7c.tar.gz
Updates from comments on OS4 compatibility pull request http://github.com/libgit2/libgit2/pull/766
Diffstat (limited to 'examples/network')
-rw-r--r--examples/network/Makefile3
-rw-r--r--examples/network/fetch.c7
2 files changed, 2 insertions, 8 deletions
diff --git a/examples/network/Makefile b/examples/network/Makefile
index 708a6b1b3..17efcfdb3 100644
--- a/examples/network/Makefile
+++ b/examples/network/Makefile
@@ -3,7 +3,6 @@ default: all
CC = gcc
CFLAGS += -g
CFLAGS += -I../../include -L../../build
-LIBS += -lgit2 -lpthread #-lregex
OBJECTS = \
git2.o \
@@ -12,4 +11,4 @@ OBJECTS = \
index-pack.o
all: $(OBJECTS)
- $(CC) $(CFLAGS) -o git2 $(OBJECTS) $(LIBS)
+ $(CC) $(CFLAGS) -o git2 $(OBJECTS)
diff --git a/examples/network/fetch.c b/examples/network/fetch.c
index fc4e94cfd..d2752124d 100644
--- a/examples/network/fetch.c
+++ b/examples/network/fetch.c
@@ -36,9 +36,7 @@ static void *download(void *ptr)
exit:
data->finished = 1;
-#ifndef NO_PTHREADS
pthread_exit(&data->ret);
-#endif
}
int update_cb(const char *refname, const git_oid *a, const git_oid *b)
@@ -83,9 +81,6 @@ int fetch(git_repository *repo, int argc, char **argv)
data.finished = 0;
memset(&stats, 0, sizeof(stats));
-#ifdef NO_PTHREADS
- download(&data);
-#else
pthread_create(&worker, NULL, download, &data);
// Loop while the worker thread is still running. Here we show processed
@@ -96,7 +91,7 @@ int fetch(git_repository *repo, int argc, char **argv)
usleep(10000);
printf("\rReceived %d/%d objects in %d bytes", stats.processed, stats.total, bytes);
} while (!data.finished);
-#endif
+
printf("\rReceived %d/%d objects in %d bytes\n", stats.processed, stats.total, bytes);
// Disconnect the underlying connection to prevent from idling.