1
0
mirror of https://github.com/irssi/irssi.git synced 2024-12-04 14:46:39 -05:00

dcc-get: close() the temp fd so we don't get ETXTBSY in ntfs mounts

Patch from debian bug 696963 [1]

Fixes github bug #220 and flyspray bug 867 [2]

[1]: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=696963
[2]: http://bugs.irssi.org/index.php?do=details&task_id=867
This commit is contained in:
Robert C Jensen 2015-09-23 23:39:37 -03:00 committed by dequis
parent ce70288488
commit b984f1fa25

View File

@ -226,6 +226,8 @@ void sig_dccget_connected(GET_DCC_REC *dcc)
else else
ret = fchmod(temphandle, dcc_file_create_mode); ret = fchmod(temphandle, dcc_file_create_mode);
close(temphandle);
if (ret != -1) { if (ret != -1) {
ret = link(tempfname, dcc->file); ret = link(tempfname, dcc->file);
@ -249,7 +251,6 @@ void sig_dccget_connected(GET_DCC_REC *dcc)
/* close/remove the temp file */ /* close/remove the temp file */
ret_errno = errno; ret_errno = errno;
close(temphandle);
unlink(tempfname); unlink(tempfname);
g_free(tempfname); g_free(tempfname);