Skip to content

Commit

Permalink
mirror: use chmod -f; fail on NO_HOST error.
Browse files Browse the repository at this point in the history
  • Loading branch information
lavv17 committed Jun 4, 2020
1 parent 8f9719b commit 65148bd
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/MirrorJob.cc
Original file line number Diff line number Diff line change
Expand Up @@ -716,6 +716,14 @@ void MirrorJob::HandleChdir(FileAccessRef& session, int &redirections)
int res=session->Done();
if(res<0)
{
if(res==FA::NO_HOST)
{
eprintf("mirror: %s\n",session->StrError(res));
stats.error_count++;
MirrorFinished();
set_state(FINISHING);
return;
}
if(res==FA::FILE_MOVED)
{
// cd to another url.
Expand Down Expand Up @@ -1256,6 +1264,7 @@ int MirrorJob::Do()
if(script)
{
ArgV args("chmod");
args.Append("-f");
args.Append(xstring::format("%03lo",(unsigned long)(file->mode&~mode_mask)));
args.Append(target_session->GetFileURL(file->name));
xstring_ca cmd(args.CombineQuoted());
Expand Down

0 comments on commit 65148bd

Please sign in to comment.