if(res < 0)
return res;
fd = open(tmpfile, O_RDWR | O_CREAT | O_TRUNC);
fd = open(tmpfile, O_RDWR | O_CREAT | O_TRUNC, 0644);
if(fd == -1) {
res = -errno;
av_log(AVLOG_ERROR, "RAR: Could not open %s: %s", tmpfile,