From e207b5415bb17e7506a174dec0658a3d773762e5 Mon Sep 17 00:00:00 2001 From: "Dr. Sathya Laufer" Date: Sun, 14 Apr 2019 15:31:14 +0200 Subject: [PATCH 1/3] Base library changes --- src/DescriptionCreator.cpp | 12 ++++++------ src/MyCentral.cpp | 2 ++ src/MyPeer.cpp | 2 ++ 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/DescriptionCreator.cpp b/src/DescriptionCreator.cpp index f38b2f8..53eb722 100644 --- a/src/DescriptionCreator.cpp +++ b/src/DescriptionCreator.cpp @@ -51,20 +51,20 @@ void DescriptionCreator::createDirectories() if(!BaseLib::Io::directoryExists(path1)) BaseLib::Io::createDirectory(path1, GD::bl->settings.dataPathPermissions()); if(localUserId != 0 || localGroupId != 0) { - if(chown(path1.c_str(), localUserId, localGroupId) == -1) std::cerr << "Could not set owner on " << path1 << std::endl; - if(chmod(path1.c_str(), GD::bl->settings.dataPathPermissions()) == -1) std::cerr << "Could not set permissions on " << path1 << std::endl; + if(chown(path1.c_str(), localUserId, localGroupId) == -1) GD::out.printWarning("Could not set owner on " + path1); + if(chmod(path1.c_str(), GD::bl->settings.dataPathPermissions()) == -1) GD::out.printWarning("Could not set permissions on " + path1); } if(!BaseLib::Io::directoryExists(path2)) BaseLib::Io::createDirectory(path2, GD::bl->settings.dataPathPermissions()); if(localUserId != 0 || localGroupId != 0) { - if(chown(path2.c_str(), localUserId, localGroupId) == -1) std::cerr << "Could not set owner on " << path2 << std::endl; - if(chmod(path2.c_str(), GD::bl->settings.dataPathPermissions()) == -1) std::cerr << "Could not set permissions on " << path2 << std::endl; + if(chown(path2.c_str(), localUserId, localGroupId) == -1) GD::out.printWarning("Could not set owner on " + path2); + if(chmod(path2.c_str(), GD::bl->settings.dataPathPermissions()) == -1) GD::out.printWarning("Could not set permissions on " + path2); } if(!BaseLib::Io::directoryExists(_xmlPath)) BaseLib::Io::createDirectory(_xmlPath, GD::bl->settings.dataPathPermissions()); if(localUserId != 0 || localGroupId != 0) { - if(chown(_xmlPath.c_str(), localUserId, localGroupId) == -1) std::cerr << "Could not set owner on " << _xmlPath << std::endl; - if(chmod(_xmlPath.c_str(), GD::bl->settings.dataPathPermissions()) == -1) std::cerr << "Could not set permissions on " << _xmlPath << std::endl; + if(chown(_xmlPath.c_str(), localUserId, localGroupId) == -1) GD::out.printWarning("Could not set owner on " + _xmlPath); + if(chmod(_xmlPath.c_str(), GD::bl->settings.dataPathPermissions()) == -1) GD::out.printWarning("Could not set permissions on " + _xmlPath); } } catch(const std::exception& ex) diff --git a/src/MyCentral.cpp b/src/MyCentral.cpp index f599fd0..333168d 100644 --- a/src/MyCentral.cpp +++ b/src/MyCentral.cpp @@ -30,6 +30,8 @@ #include "MyCentral.h" #include "GD.h" +#include + namespace MyFamily { MyCentral::MyCentral(ICentralEventSink* eventHandler) : BaseLib::Systems::ICentral(MY_FAMILY_ID, GD::bl, eventHandler) diff --git a/src/MyPeer.cpp b/src/MyPeer.cpp index 3b72cef..1b8eb53 100644 --- a/src/MyPeer.cpp +++ b/src/MyPeer.cpp @@ -33,6 +33,8 @@ #include "MyPacket.h" #include "MyCentral.h" +#include + namespace MyFamily { std::shared_ptr MyPeer::getCentral() From 0875474a52a2c05021d8ada865d0608ec1888e81 Mon Sep 17 00:00:00 2001 From: "Dr. Sathya Laufer" Date: Sun, 14 Apr 2019 16:20:35 +0200 Subject: [PATCH 2/3] Base library changes --- getVersion.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/getVersion.sh b/getVersion.sh index c6a83f7..7915652 100755 --- a/getVersion.sh +++ b/getVersion.sh @@ -2,6 +2,7 @@ dir=`mktemp -d` cat > "$dir/libhomegear-base-version.cpp" <<-'EOF' #include "homegear-base/BaseLib.h" +#include int main(int argc, char** argv) { @@ -9,7 +10,7 @@ int main(int argc, char** argv) return 0; } EOF -g++ -std=c++11 -o $dir/libhomegear-base-version $dir/libhomegear-base-version.cpp -lhomegear-base -lgcrypt -lgnutls +g++ -std=c++11 -o $dir/libhomegear-base-version $dir/libhomegear-base-version.cpp -lhomegear-base -lgcrypt -lgnutls -lpthread chmod 755 $dir/libhomegear-base-version $dir/libhomegear-base-version rm -Rf $dir From c11a4b792cb2a590b7707bacd226e937590d8fd1 Mon Sep 17 00:00:00 2001 From: "Dr. Sathya Laufer" Date: Fri, 12 Jul 2019 13:24:35 +0200 Subject: [PATCH 3/3] Added -latomic to getVersion.sh --- getVersion.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/getVersion.sh b/getVersion.sh index 7915652..5cb7a57 100755 --- a/getVersion.sh +++ b/getVersion.sh @@ -10,7 +10,7 @@ int main(int argc, char** argv) return 0; } EOF -g++ -std=c++11 -o $dir/libhomegear-base-version $dir/libhomegear-base-version.cpp -lhomegear-base -lgcrypt -lgnutls -lpthread +g++ -std=c++11 -o $dir/libhomegear-base-version $dir/libhomegear-base-version.cpp -lhomegear-base -lgcrypt -lgnutls -lpthread -latomic chmod 755 $dir/libhomegear-base-version $dir/libhomegear-base-version rm -Rf $dir