Skip to content

Commit

Permalink
[XrdCl] Document xrdcp return codes, closes #628
Browse files Browse the repository at this point in the history
  • Loading branch information
simonmichal committed May 25, 2018
1 parent a497919 commit a63f06a
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 4 deletions.
16 changes: 16 additions & 0 deletions docs/man/xrdcp.1
Expand Up @@ -462,6 +462,22 @@ XRD_PREFERIPV4
If set the client tries first IPv4 address (turned off by default).
.RE

.SH RETURN CODES
.RE
\fB50\fR : generic error (e.g. config, internal, data, OS)

\fB51\fR : socket related error

\fB52\fR : pastmaster related error

\fB53\fR : XRootD related error

\fB54\fR : redirection error

\fB254\fR : command line option error

\fB255\fR : problem with source / destination (e.g. multiple sources were given, but target is not a directory)

.SH NOTES
Documentation for all components associated with \fBxrdcp\fR can be found at
http://xrootd.org/docs.html
Expand Down
10 changes: 6 additions & 4 deletions src/XrdCl/XrdClCopy.cc
Expand Up @@ -652,8 +652,9 @@ int main( int argc, char **argv )
char *cwd = getcwd( buf, FILENAME_MAX );
if( !cwd )
{
std::cerr << strerror( errno ) << std::endl;
return errno;
XRootDStatus st( stError, XProtocol::mapError( errno ), errno, strerror( errno ) );
std::cerr << st.GetErrorMessage() << std::endl;
return st.GetShellCode();
}
dest += cwd;
dest += '/';
Expand Down Expand Up @@ -755,8 +756,9 @@ int main( int argc, char **argv )
char *cwd = getcwd( buf, FILENAME_MAX );
if( !cwd )
{
std::cerr << strerror( errno ) << std::endl;
return errno;
XRootDStatus st( stError, XProtocol::mapError( errno ), errno, strerror( errno ) );
std::cerr << st.GetErrorMessage() << std::endl;
return st.GetShellCode();
}
source = "file://" + std::string( cwd ) + '/' + source;
}
Expand Down

0 comments on commit a63f06a

Please sign in to comment.