diff options
author | David Phillips <david@sighup.nz> | 2017-04-30 20:22:28 +1200 |
---|---|---|
committer | David Phillips <david@sighup.nz> | 2017-04-30 20:22:28 +1200 |
commit | 17b3b7432e5e04f2171308796cdb72a5dd919919 (patch) | |
tree | cc4ab99e19b8b02f21eb13f2020d4cf0b953cfc2 | |
parent | a6bb6e11de058da38136dc2b5ba29a29d74a7985 (diff) | |
download | sand-leek-17b3b7432e5e04f2171308796cdb72a5dd919919.tar.xz |
Relocate variable declaration to top of main
-rw-r--r-- | sand-leek.c | 3 |
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++; |