Lines Matching defs:tmppath
13 static int file_copy_to_tmp(const char *srcpath, const char *tmppath,
25 if (link(srcpath, tmppath) == 0)
28 if (i_unlink_if_exists(tmppath) < 0)
30 if (link(srcpath, tmppath) == 0)
36 i_error("link(%s, %s) failed: %m", srcpath, tmppath);
58 fd_out = open(tmppath, O_WRONLY | O_CREAT | O_TRUNC, st.st_mode);
61 i_error("open(%s, O_CREAT) failed: %m", tmppath);
68 i_error("fchown(%s) failed: %m", tmppath);
85 i_error("write(%s) failed: %s", tmppath,
98 i_error("close(%s) failed: %m", tmppath);
109 const char *tmppath;
111 tmppath = t_strconcat(destpath, ".tmp", NULL);
113 ret = file_copy_to_tmp(srcpath, tmppath, try_hardlink);
115 if (rename(tmppath, destpath) < 0) {
117 tmppath, destpath);
122 i_unlink(tmppath);