Blob Blame History Raw
commit cced98651e9650ac4b05cca6a7c12d18a32b6afc
Author: Petr Vokac <petr.vokac@fjfi.cvut.cz>
Date:   Fri Oct 16 10:01:39 2020 +0200

    LCGDM-2951 fix file descriptor string formatting

diff --git a/src/plugins/adapter/IO.cpp b/src/plugins/adapter/IO.cpp
index f3ab3fb0..4d1ebbb7 100644
--- a/src/plugins/adapter/IO.cpp
+++ b/src/plugins/adapter/IO.cpp
@@ -242,7 +242,7 @@ size_t StdIOHandler::read(char* buffer, size_t count)
   if (nbytes < 0) {
     char errbuffer[128];
     dpm_strerror_r(errno, errbuffer, sizeof(errbuffer));
-    throw DmException(errno, "%s on fd %s ", errbuffer, this->fd_);
+    throw DmException(errno, "%s on fd %d", errbuffer, this->fd_);
   }
 
   eof_ = (static_cast<size_t>(nbytes) < count);
@@ -260,7 +260,7 @@ size_t StdIOHandler::write(const char* buffer, size_t count)
   if (nbytes < 0) {
     char errbuffer[128];
     dpm_strerror_r(errno, errbuffer, sizeof(errbuffer));
-    throw DmException(errno, "%s on fd %s ", errbuffer, this->fd_);
+    throw DmException(errno, "%s on fd %d", errbuffer, this->fd_);
   }
 
   return static_cast<size_t>(nbytes);
@@ -276,7 +276,7 @@ size_t StdIOHandler::readv(const struct iovec* vector, size_t count)
   if (nbytes < 0) {
     char errbuffer[128];
     dpm_strerror_r(errno, errbuffer, sizeof(errbuffer));
-    throw DmException(errno, "%s on fd %s ", errbuffer, this->fd_);
+    throw DmException(errno, "%s on fd %d", errbuffer, this->fd_);
   }
 
   return static_cast<size_t>(nbytes);
@@ -292,7 +292,7 @@ size_t StdIOHandler::writev(const struct iovec* vector, size_t count)
   if (nbytes < 0) {
     char errbuffer[128];
     dpm_strerror_r(errno, errbuffer, sizeof(errbuffer));
-    throw DmException(errno, "%s on fd %s ", errbuffer, this->fd_);
+    throw DmException(errno, "%s on fd %d", errbuffer, this->fd_);
   }
 
   return static_cast<size_t>(nbytes);
@@ -308,7 +308,7 @@ size_t StdIOHandler::pread(void* buffer, size_t count, off_t offset)
   if (nbytes < 0) {
     char errbuffer[128];
     dpm_strerror_r(errno, errbuffer, sizeof(errbuffer));
-    throw DmException(errno, "%s on fd %s ", errbuffer, this->fd_);
+    throw DmException(errno, "%s on fd %d", errbuffer, this->fd_);
   }
 
   return static_cast<size_t>(nbytes);
@@ -324,7 +324,7 @@ size_t StdIOHandler::pwrite(const void* buffer, size_t count, off_t offset)
   if (nbytes < 0) {
     char errbuffer[128];
     dpm_strerror_r(errno, errbuffer, sizeof(errbuffer));
-    throw DmException(errno, "%s on fd %s ", errbuffer, this->fd_);
+    throw DmException(errno, "%s on fd %d", errbuffer, this->fd_);
   }
 
   return static_cast<size_t>(nbytes);
@@ -336,7 +336,7 @@ void StdIOHandler::seek(off_t offset, Whence whence)
 {
   Log(Logger::Lvl4, adapterlogmask, adapterlogname, " fd:" << this->fd_ << " offs:" << offset);
   if (::lseek64(this->fd_, offset, whence) == ((off_t) - 1))
-    throw DmException(errno, "Could not seek on fd %s ", this->fd_);
+    throw DmException(errno, "Could not seek on fd %d", this->fd_);
 }
 
 
diff --git a/src/plugins/adapter/RFIO.cpp b/src/plugins/adapter/RFIO.cpp
index 25568b79..3dab1566 100644
--- a/src/plugins/adapter/RFIO.cpp
+++ b/src/plugins/adapter/RFIO.cpp
@@ -303,7 +303,7 @@ void StdRFIOHandler::seek(off_t offset, Whence whence)
 
   lk l(islocal_ ? 0 : &this->mtx_);
   if (rfio_lseek64(this->fd_, offset, whence) == -1)
-    throw DmException(serrno, "Could not seek fd %s", this->fd_);
+    throw DmException(serrno, "Could not seek fd %d", this->fd_);
 
   Log(Logger::Lvl3, adapterRFIOlogmask, adapterRFIOlogname, "Exiting. offs:" << offset);
 }
diff --git a/src/plugins/domeadapter/DomeAdapterIO.cpp b/src/plugins/domeadapter/DomeAdapterIO.cpp
index f89c16f8..63a0b4ed 100644
--- a/src/plugins/domeadapter/DomeAdapterIO.cpp
+++ b/src/plugins/domeadapter/DomeAdapterIO.cpp
@@ -355,7 +355,7 @@ size_t DomeIOHandler::read(char* buffer, size_t count)
   if (nbytes < 0) {
     char errbuffer[128];
     dpm_strerror_r(errno, errbuffer, sizeof(errbuffer));
-    throw DmException(errno, "%s on fd %s ", errbuffer, this->fd_);
+    throw DmException(errno, "%s on fd %d", errbuffer, this->fd_);
   }
 
   eof_ = (static_cast<size_t>(nbytes) < count);
@@ -373,7 +373,7 @@ size_t DomeIOHandler::write(const char* buffer, size_t count)
   if (nbytes < 0) {
     char errbuffer[128];
     dpm_strerror_r(errno, errbuffer, sizeof(errbuffer));
-    throw DmException(errno, "%s on fd %s ", errbuffer, this->fd_);
+    throw DmException(errno, "%s on fd %d", errbuffer, this->fd_);
   }
 
   return static_cast<size_t>(nbytes);
@@ -389,7 +389,7 @@ size_t DomeIOHandler::readv(const struct iovec* vector, size_t count)
   if (nbytes < 0) {
     char errbuffer[128];
     dpm_strerror_r(errno, errbuffer, sizeof(errbuffer));
-    throw DmException(errno, "%s on fd %s ", errbuffer, this->fd_);
+    throw DmException(errno, "%s on fd %d", errbuffer, this->fd_);
   }
 
   return static_cast<size_t>(nbytes);
@@ -405,7 +405,7 @@ size_t DomeIOHandler::writev(const struct iovec* vector, size_t count)
   if (nbytes < 0) {
     char errbuffer[128];
     dpm_strerror_r(errno, errbuffer, sizeof(errbuffer));
-    throw DmException(errno, "%s on fd %s ", errbuffer, this->fd_);
+    throw DmException(errno, "%s on fd %d", errbuffer, this->fd_);
   }
 
   return static_cast<size_t>(nbytes);
@@ -421,7 +421,7 @@ size_t DomeIOHandler::pread(void* buffer, size_t count, off_t offset)
   if (nbytes < 0) {
     char errbuffer[128];
     dpm_strerror_r(errno, errbuffer, sizeof(errbuffer));
-    throw DmException(errno, "%s on fd %s ", errbuffer, this->fd_);
+    throw DmException(errno, "%s on fd %d", errbuffer, this->fd_);
   }
 
   return static_cast<size_t>(nbytes);
@@ -437,7 +437,7 @@ size_t DomeIOHandler::pwrite(const void* buffer, size_t count, off_t offset)
   if (nbytes < 0) {
     char errbuffer[128];
     dpm_strerror_r(errno, errbuffer, sizeof(errbuffer));
-    throw DmException(errno, "%s on fd %s ", errbuffer, this->fd_);
+    throw DmException(errno, "%s on fd %d", errbuffer, this->fd_);
   }
 
   return static_cast<size_t>(nbytes);
@@ -449,7 +449,7 @@ void DomeIOHandler::seek(off_t offset, Whence whence)
 {
   Log(Logger::Lvl4, domeadapterlogmask, domeadapterlogname, " fd:" << this->fd_ << " offs:" << offset);
   if (::lseek64(this->fd_, offset, whence) == ((off_t) - 1))
-    throw DmException(errno, "Could not seek on fd %s ", this->fd_);
+    throw DmException(errno, "Could not seek on fd %d", this->fd_);
 }