Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
dCache
cta
Commits
b85b17af
Commit
b85b17af
authored
Sep 16, 2014
by
Steven Murray
Browse files
CASTORCASTOR-4636: rtcpd of 2.1.15 cannot verify tapes
Fixed.
parent
3d30fabc
Changes
1
Hide whitespace changes
Inline
Side-by-side
rtcopy/rtcp_xroot.cpp
View file @
b85b17af
...
...
@@ -34,6 +34,11 @@ extern "C" {
#include <common.h>
#include <pthread.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include "castor/exception/Exception.hpp"
#include <XrdPosix/XrdPosixExtern.hh>
...
...
@@ -179,8 +184,17 @@ int rtcp_xroot_stat(const char *path, struct stat *buf) {
int
rtcp_xroot_open
(
const
char
*
path
,
int
oflag
,
int
mode
)
{
try
{
std
::
string
xrootURL
=
rtcpToCastorXroot
(
path
);
return
XrdPosix_Open
(
xrootURL
.
c_str
(),
oflag
,
mode
);
// If a tape is being verified by writing its contents to /dev/null
if
((
oflag
|
O_WRONLY
)
&&
!
strcmp
(
path
,
"localhost:/dev/null"
))
{
// Force xroot posix API to open the local file /dev/null
return
XrdPosix_Open
(
"/dev/null"
,
oflag
,
mode
);
// Else this is the normal recall or migration of a file
}
else
{
const
std
::
string
xrootURL
=
rtcpToCastorXroot
(
path
);
return
XrdPosix_Open
(
xrootURL
.
c_str
(),
oflag
,
mode
);
}
}
catch
(
castor
::
exception
::
Exception
e
)
{
errno
=
EFAULT
;
/* sets "Bad address" errno */
return
-
1
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment