Commit b85b17af authored by Steven Murray's avatar Steven Murray
Browse files

CASTORCASTOR-4636: rtcpd of 2.1.15 cannot verify tapes

Fixed.
parent 3d30fabc
......@@ -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;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment