improve error message in config.c

Show errno if opening a lockfile fails.

Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Alex Riesen 2009-04-29 23:27:54 +02:00 committed by Junio C Hamano
parent d1c8c0c8c4
commit 6ffd567bec

View File

@ -1001,7 +1001,7 @@ int git_config_set_multivar(const char* key, const char* value,
lock = xcalloc(sizeof(struct lock_file), 1); lock = xcalloc(sizeof(struct lock_file), 1);
fd = hold_lock_file_for_update(lock, config_filename, 0); fd = hold_lock_file_for_update(lock, config_filename, 0);
if (fd < 0) { if (fd < 0) {
error("could not lock config file %s", config_filename); error("could not lock config file %s: %s", config_filename, strerror(errno));
free(store.key); free(store.key);
ret = -1; ret = -1;
goto out_free; goto out_free;