return -1;
}
- if (move_file(cinfo->sysassert_cs_path, move_path) < 0) {
+ if (move_file(move_path, cinfo->sysassert_cs_path) < 0) {
_E("Failed to move %s to %s",
cinfo->sysassert_cs_path, move_path);
return -1;
fsync(out_fd);
fprintf_fd(out_fd, "\n%s(%s)\n",
dump_item[i].title, dump_item[i].path);
- ret = dump_file_write_fd((char *)dump_item[i].path, out_fd);
+ ret = dump_file_write_fd(out_fd, (char *)dump_item[i].path);
INFORM_IF_ERROR(ret)
}
fprintf_fd(out_fd, "\n");
return r == 0 ? r : copy_bytes_rw(destfd, srcfd, ncopied);
}
-int copy_file(char *src, char *dst)
+int copy_file(char *dst, char *src)
{
int res;
int sfd;
return res;
}
-int move_file(char *src, char *dst)
+int move_file(char *dst, char *src)
{
- if (copy_file(src, dst) < 0)
+ if (copy_file(dst, src) < 0)
return -1;
if (unlink(src) < 0)
return -1;
return 1;
}
-int dump_file_write_fd(char *src, int dfd)
+int dump_file_write_fd(int dfd, char *src)
{
int res;
int sfd;
int copy_bytes(int destfd, int srcfd, off_t *ncopied);
-int copy_file(char *src, char *dst);
+int copy_file(char *dst, char *src);
-int move_file(char *src, char *dst);
+int move_file(char *dst, char *src);
-int dump_file_write_fd(char *src, int dfd);
+int dump_file_write_fd(int dfd, char *src);
int run_command_write_fd_timeout(char *path, char *args[], char *env[], int dfd, char *buff, int size, int timeout);