Blob Blame History Raw
From b0584849cfcd36bce4467df5b4d5a36282d09c77 Mon Sep 17 00:00:00 2001
From: Mattias Ellert <mattias.ellert@physics.uu.se>
Date: Tue, 14 Dec 2021 09:56:45 +0100
Subject: [PATCH] Define ENODATA if not defined
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Fixes compilation errors on Debian kfreebsd:

../src/XrdOuc/XrdOucUtils.cc: In static member function ‘static char* XrdOucUtils::getFile(const char*, int&, int, bool)’:
../src/XrdOuc/XrdOucUtils.cc:474:45: error: ‘ENODATA’ was not declared in this scope
  474 |    if (Stat.st_size == 0 && notempty) {rc = ENODATA; return 0;}
      |                                             ^~~~~~~
---
 src/XrdOuc/XrdOucUtils.cc | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/XrdOuc/XrdOucUtils.cc b/src/XrdOuc/XrdOucUtils.cc
index ca54350e6..c6b96b7ee 100644
--- a/src/XrdOuc/XrdOucUtils.cc
+++ b/src/XrdOuc/XrdOucUtils.cc
@@ -53,7 +53,11 @@
 #include "XrdSys/XrdSysError.hh"
 #include "XrdSys/XrdSysPlatform.hh"
 #include "XrdSys/XrdSysPthread.hh"
-  
+
+#ifndef ENODATA
+#define ENODATA ENOATTR
+#endif
+
 /******************************************************************************/
 /*                         L o c a l   M e t h o d s                          */
 /******************************************************************************/
@@ -469,7 +473,7 @@ char *XrdOucUtils::getFile(const char *path, int &rc, int maxsz, bool notempty)
 //
    if (Stat.st_size > maxsz) {rc = EFBIG; return 0;}
 
-// Make sure the file is not empty is empty files are disallowed
+// Make sure the file is not empty if empty files are disallowed
 //
    if (Stat.st_size == 0 && notempty) {rc = ENODATA; return 0;}
 
-- 
2.33.1