summaryrefslogtreecommitdiff
path: root/ftp/downloader/files/patch-main::dlist.cc
diff options
context:
space:
mode:
authorYing-Chieh Liao <ijliao@FreeBSD.org>2001-03-20 13:33:25 +0000
committerYing-Chieh Liao <ijliao@FreeBSD.org>2001-03-20 13:33:25 +0000
commit2d45762f817af164cb28b3f4ebbd949cb321f05e (patch)
tree2eba940eb8b23735f367c172cc9fedfceb232519 /ftp/downloader/files/patch-main::dlist.cc
parentUpdate to version 0.4.62 (diff)
upgrade to 1.24.1
PR: 25930 Submitted by: KATO Tsuguru <tkato@prontomail.ne.jp>, lioux
Notes
Notes: svn path=/head/; revision=40103
Diffstat (limited to 'ftp/downloader/files/patch-main::dlist.cc')
-rw-r--r--ftp/downloader/files/patch-main::dlist.cc43
1 files changed, 43 insertions, 0 deletions
diff --git a/ftp/downloader/files/patch-main::dlist.cc b/ftp/downloader/files/patch-main::dlist.cc
new file mode 100644
index 000000000000..78716702b24c
--- /dev/null
+++ b/ftp/downloader/files/patch-main::dlist.cc
@@ -0,0 +1,43 @@
+--- dlist.cc.orig Wed Mar 14 10:52:01 2001
++++ dlist.cc Wed Mar 14 16:47:21 2001
+@@ -62,7 +62,7 @@
+ a.l_type=F_WRLCK;
+ a.l_whence=SEEK_SET;
+ a.l_start=0;
+- a.l_len=1;
++ a.l_len=0;
+ if (fcntl(fd,F_SETLK,&a)==-1)
+ return(-1);
+ return(0);
+@@ -73,7 +73,7 @@
+ a.l_type=F_UNLCK;
+ a.l_whence=SEEK_SET;
+ a.l_start=0;
+- a.l_len=1;
++ a.l_len=0;
+ fcntl(fd,F_SETLK,&a);
+ };
+
+@@ -360,11 +360,17 @@
+ im_first=0;
+ if (segments==NULL){
+ /*trying to lock*/
+- if (d4x_f_lock(fdesc)){
+- WL->log(LOG_ERROR,_("File is already opened by another download!"));
+- close(fdesc);
+- return(-1);
+- };
++ if(d4x_f_lock(fdesc))
++ switch(errno) {
++ case EINVAL:
++ WL->log(LOG_WARNING,_("Filesystem seems not to support advisory record locking!"));
++ WL->log(LOG_WARNING,_("Will proceed without it but beware that you might have problems."));
++ break;
++ default:
++ WL->log(LOG_ERROR,_("File is already opened by another download!"));
++ close(fdesc);
++ return(-1);
++ };
+ /*end of trying */
+ segments=new tSegmentator;
+ char *segname=sum_strings(name,".segments",NULL);