diff options
author | Robert C Jensen <jensen.r@husky.neu.edu> | 2015-09-23 23:39:37 -0300 |
---|---|---|
committer | dequis <dx@dxzone.com.ar> | 2015-09-23 23:39:37 -0300 |
commit | b984f1fa250fd87b2808bed6826f17386ddb30ce (patch) | |
tree | 93361bcbd9a03112564e30d029217aa6687c0e00 /src/irc/dcc | |
parent | ce702884889165a775d66b0eb248009cd0ac75bb (diff) | |
download | irssi-b984f1fa250fd87b2808bed6826f17386ddb30ce.zip |
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
Diffstat (limited to 'src/irc/dcc')
-rw-r--r-- | src/irc/dcc/dcc-get.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/irc/dcc/dcc-get.c b/src/irc/dcc/dcc-get.c index 1208b5c5..a8b1c967 100644 --- a/src/irc/dcc/dcc-get.c +++ b/src/irc/dcc/dcc-get.c @@ -226,6 +226,8 @@ void sig_dccget_connected(GET_DCC_REC *dcc) else ret = fchmod(temphandle, dcc_file_create_mode); + close(temphandle); + if (ret != -1) { ret = link(tempfname, dcc->file); @@ -249,7 +251,6 @@ void sig_dccget_connected(GET_DCC_REC *dcc) /* close/remove the temp file */ ret_errno = errno; - close(temphandle); unlink(tempfname); g_free(tempfname); |