From aacd1628371129839fba01722e14e6c7ce1bda2a Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Fri, 4 Nov 2016 09:59:51 -0700 Subject: [PROPOSED] Add zic.c comment * zic.c (dolink): Say why EEXIST optimization is valid. --- zic.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/zic.c b/zic.c index b8e8e03..47c68f9 100644 --- a/zic.c +++ b/zic.c @@ -3144,6 +3144,9 @@ mkdirs(char const *argname, bool ancestors) ** is checked anyway if the mkdir fails. */ if (mkdir(name, MKDIR_UMASK) != 0) { + /* For speed, skip itsdir if errno == EEXIST. Since + mkdirs is called only after open fails with ENOENT + on a subfile, EEXIST implies itsdir here. */ int err = errno; if (err != EEXIST && !itsdir(name)) { error(_("%s: Can't create directory %s: %s"), -- 2.7.4