*/
if (mkdir(buf, 0777)) {
if (errno == EEXIST && state->force &&
- !unlink(buf) && !mkdir(buf, 0777))
+ !unlink_or_warn(buf) && !mkdir(buf, 0777))
continue;
die("cannot create directory at %s", buf);
}
wrote = write_in_full(fd, new, size);
/* use fstat() only when path == ce->name */
- if (state->refresh_cache && !to_tempfile && !state->base_dir_len) {
+ if (fstat_is_reliable() &&
+ state->refresh_cache && !to_tempfile && !state->base_dir_len) {
fstat(fd, &st);
fstat_done = 1;
}