aboutsummaryrefslogtreecommitdiff
path: root/sand-leek.c
diff options
context:
space:
mode:
authorDavid Phillips <david@sighup.nz>2017-04-30 20:22:28 +1200
committerDavid Phillips <david@sighup.nz>2017-04-30 20:22:28 +1200
commit17b3b7432e5e04f2171308796cdb72a5dd919919 (patch)
treecc4ab99e19b8b02f21eb13f2020d4cf0b953cfc2 /sand-leek.c
parenta6bb6e11de058da38136dc2b5ba29a29d74a7985 (diff)
downloadsand-leek-17b3b7432e5e04f2171308796cdb72a5dd919919.tar.xz
Relocate variable declaration to top of main
Diffstat (limited to 'sand-leek.c')
-rw-r--r--sand-leek.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sand-leek.c b/sand-leek.c
index 130d322..6cf5174 100644
--- a/sand-leek.c
+++ b/sand-leek.c
@@ -228,6 +228,7 @@ int
main(int argc, char **argv) {
int opt = '\0';
int thread_count = 1;
+ int loops = 0;
int i = 0;
size_t offset = 0;
pthread_t *workers = NULL;
@@ -285,8 +286,8 @@ main(int argc, char **argv) {
}
}
- int loops = 0;
/* workers started; wait on one to finish */
+ loops = 0;
while (sem_trywait(&working) && errno == EAGAIN) {
sleep(1);
loops++;