X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=builtin%2Fpack-objects.c;h=f8eba53c82242d0c435524ab9ffab70ba2e2d5ad;hb=385cc9d8c44eb5be9d57e630129752a72c0a08c8;hp=214d7ef2b12d41e8d70539fe4a4b16fde71a780a;hpb=12575b78fbc6db9eb8de12c8146c7d27eb821e09;p=git.git diff --git a/builtin/pack-objects.c b/builtin/pack-objects.c index 214d7ef2b..f8eba53c8 100644 --- a/builtin/pack-objects.c +++ b/builtin/pack-objects.c @@ -23,15 +23,15 @@ #endif static const char pack_usage[] = - "git pack-objects [{ -q | --progress | --all-progress }]\n" + "git pack-objects [ -q | --progress | --all-progress ]\n" " [--all-progress-implied]\n" - " [--max-pack-size=N] [--local] [--incremental]\n" - " [--window=N] [--window-memory=N] [--depth=N]\n" + " [--max-pack-size=] [--local] [--incremental]\n" + " [--window=] [--window-memory=] [--depth=]\n" " [--no-reuse-delta] [--no-reuse-object] [--delta-base-offset]\n" - " [--threads=N] [--non-empty] [--revs [--unpacked | --all]*]\n" + " [--threads=] [--non-empty] [--revs [--unpacked | --all]]\n" " [--reflog] [--stdout | base-name] [--include-tag]\n" - " [--keep-unreachable | --unpack-unreachable \n" - " [idx; /* make sure off_t is sufficiently large not to wrap */ - if (*offset > *offset + size) + if (signed_add_overflows(*offset, size)) die("pack too large for current definition of off_t"); *offset += size; return 1; @@ -1529,6 +1529,8 @@ static void try_to_free_from_threads(size_t size) read_unlock(); } +try_to_free_t old_try_to_free_routine; + /* * The main thread waits on the condition that (at least) one of the workers * has stopped working (which is indicated in the .working member of @@ -1563,12 +1565,12 @@ static void init_threaded_search(void) pthread_mutex_init(&cache_mutex, NULL); pthread_mutex_init(&progress_mutex, NULL); pthread_cond_init(&progress_cond, NULL); - set_try_to_free_routine(try_to_free_from_threads); + old_try_to_free_routine = set_try_to_free_routine(try_to_free_from_threads); } static void cleanup_threaded_search(void) { - set_try_to_free_routine(NULL); + set_try_to_free_routine(old_try_to_free_routine); pthread_cond_destroy(&progress_cond); pthread_mutex_destroy(&read_mutex); pthread_mutex_destroy(&cache_mutex);