write_file: use xopen
commitee861e0f78367ff0e94feeb42f721ef83ceec251
authorJeff King <peff@peff.net>
Fri, 8 Jul 2016 09:10:08 +0000 (8 05:10 -0400)
committerJunio C Hamano <gitster@pobox.com>
Fri, 8 Jul 2016 16:47:29 +0000 (8 09:47 -0700)
treecd8b5a9aa1f345246ae1657bfe238df3a35705f8
parentef22318cff51244cd0047b11ee7accfded522782
write_file: use xopen

This simplifies the code a tiny bit, and provides consistent
error messages with other users of xopen().

While we're here, let's also switch to using O_WRONLY. We
know we're only going to open/write/close the file, so
there's no point in asking for O_RDWR.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
wrapper.c