summaryrefslogtreecommitdiff
path: root/src/irc/dcc
diff options
context:
space:
mode:
authorEmanuele Giaquinta <exg@irssi.org>2007-10-29 15:37:31 +0000
committerexg <exg@dbcabf3a-b0e7-0310-adc4-f8d773084564>2007-10-29 15:37:31 +0000
commitd9782fab84a66a04eb42bb8804236a860b799574 (patch)
treed3bb14b74b4e996883a577a0f08d401e831da2b1 /src/irc/dcc
parentcfcbb9a7b1b3049e7f92062c38ff834def80d818 (diff)
downloadirssi-d9782fab84a66a04eb42bb8804236a860b799574.zip
Fallback on rename also when errno is ENOSYS/EOPNOTSUPP because
FUSE/BSD sets this value when link is not available. Based on a patch by Juuso Tähkäpää, bug 536. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@4631 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/irc/dcc')
-rw-r--r--src/irc/dcc/dcc-get.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/irc/dcc/dcc-get.c b/src/irc/dcc/dcc-get.c
index e53a0d23..e8e67731 100644
--- a/src/irc/dcc/dcc-get.c
+++ b/src/irc/dcc/dcc-get.c
@@ -226,7 +226,13 @@ void sig_dccget_connected(GET_DCC_REC *dcc)
if (ret != -1) {
ret = link(tempfname, dcc->file);
- if (ret == -1 && errno == EPERM) {
+ if (ret == -1 &&
+ /* Linux */
+ (errno == EPERM ||
+ /* FUSE */
+ errno == ENOSYS ||
+ /* BSD */
+ errno == EOPNOTSUPP)) {
/* hard links aren't supported - some people
want to download stuff to FAT/NTFS/etc
partitions, so fallback to rename() */