|
|
@ -168,8 +168,8 @@ static int write_entry(struct cache_entry *ce, |
|
|
|
ret = symlink(new, path); |
|
|
|
ret = symlink(new, path); |
|
|
|
free(new); |
|
|
|
free(new); |
|
|
|
if (ret) |
|
|
|
if (ret) |
|
|
|
return error("unable to create symlink %s (%s)", |
|
|
|
return error_errno("unable to create symlink %s", |
|
|
|
path, strerror(errno)); |
|
|
|
path); |
|
|
|
break; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -186,8 +186,7 @@ static int write_entry(struct cache_entry *ce, |
|
|
|
fd = open_output_fd(path, ce, to_tempfile); |
|
|
|
fd = open_output_fd(path, ce, to_tempfile); |
|
|
|
if (fd < 0) { |
|
|
|
if (fd < 0) { |
|
|
|
free(new); |
|
|
|
free(new); |
|
|
|
return error("unable to create file %s (%s)", |
|
|
|
return error_errno("unable to create file %s", path); |
|
|
|
path, strerror(errno)); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
wrote = write_in_full(fd, new, size); |
|
|
|
wrote = write_in_full(fd, new, size); |
|
|
@ -284,8 +283,7 @@ int checkout_entry(struct cache_entry *ce, |
|
|
|
return error("%s is a directory", path.buf); |
|
|
|
return error("%s is a directory", path.buf); |
|
|
|
remove_subtree(&path); |
|
|
|
remove_subtree(&path); |
|
|
|
} else if (unlink(path.buf)) |
|
|
|
} else if (unlink(path.buf)) |
|
|
|
return error("unable to unlink old '%s' (%s)", |
|
|
|
return error_errno("unable to unlink old '%s'", path.buf); |
|
|
|
path.buf, strerror(errno)); |
|
|
|
|
|
|
|
} else if (state->not_new) |
|
|
|
} else if (state->not_new) |
|
|
|
return 0; |
|
|
|
return 0; |
|
|
|
|
|
|
|
|
|
|
|