diff options
author | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | 2018-11-03 09:48:50 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-11-05 05:42:11 +0100 |
commit | 2179045fd02acca83127f8d15ccd0eeb70b17400 (patch) | |
tree | 9fdc037f4ae68e04712ddc63d77d5a2955471674 /run-command.c | |
parent | read-cache.c: initialize copy_len to shut up gcc 8 (diff) | |
download | git-2179045fd02acca83127f8d15ccd0eeb70b17400.tar.xz git-2179045fd02acca83127f8d15ccd0eeb70b17400.zip |
Clean up pthread_create() error handling
Normally pthread_create() rarely fails. But with new pthreads wrapper,
pthread_create() will return ENOSYS on a system without thread support.
Threaded code _is_ protected by HAVE_THREADS and pthread_create()
should never run in the first place. But the situation could change in
the future and bugs may sneak in. Make sure that all pthread_create()
reports the error cause.
While at there, mark these strings for translation if they aren't.
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'run-command.c')
-rw-r--r-- | run-command.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/run-command.c b/run-command.c index 3c3b8814df..decf3239bd 100644 --- a/run-command.c +++ b/run-command.c @@ -1213,7 +1213,7 @@ int start_async(struct async *async) { int err = pthread_create(&async->tid, NULL, run_thread, async); if (err) { - error_errno("cannot create thread"); + error(_("cannot create async thread: %s"), strerror(err)); goto error; } } |