From 1a42dd17eb2c35fa572418f5958595cbe297d229 Mon Sep 17 00:00:00 2001 From: Russell Belfer Date: Fri, 31 May 2013 14:13:11 -0700 Subject: Mutex init can fail It is obviously quite a serious problem if this happens, but mutex initialization can fail and we should detect it. It's a bit like a memory allocation failure, in that you're probably pretty screwed if this occurs, but at least we'll catch it. --- src/pack-objects.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/pack-objects.c') diff --git a/src/pack-objects.c b/src/pack-objects.c index 3d382026e..500104c55 100644 --- a/src/pack-objects.c +++ b/src/pack-objects.c @@ -132,7 +132,10 @@ int git_packbuilder_new(git_packbuilder **out, git_repository *repo) if (git_mutex_init(&pb->cache_mutex) || git_mutex_init(&pb->progress_mutex) || git_cond_init(&pb->progress_cond)) + { + giterr_set(GITERR_OS, "Failed to initialize packbuilder mutex"); goto on_error; + } #endif -- cgit v1.2.1