From 97ca2423a4686f7f9e85a33a88556dae4aad1bab Mon Sep 17 00:00:00 2001 From: Maximilien Siavelis <m@siav.pw> Date: 周一, 06 5月 2019 21:47:20 +0800 Subject: [PATCH] Merge pull request #21 from matteovaralta91/master --- src/library/os/os-linux.c | 1 + src/tools/license-generator/license-generator.cpp | 2 +- example/example.cpp | 2 +- src/library/ini/SimpleIni.h | 3 +++ example/CMakeLists.txt | 3 ++- CMakeLists.txt | 1 + 6 files changed, 9 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 49fcd95..36c3611 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -98,6 +98,7 @@ list(APPEND EXTERNAL_LIBS ${DBUS_LIBRARIES}) endif(USE_DBUS_IDENTIFIER) list(APPEND EXTERNAL_LIBS dl) + list(APPEND EXTERNAL_LIBS "-Wl,-Bdynamic") endif(NOT MSVC) configure_file ( diff --git a/example/CMakeLists.txt b/example/CMakeLists.txt index e6b1ee1..425fb92 100644 --- a/example/CMakeLists.txt +++ b/example/CMakeLists.txt @@ -1,4 +1,5 @@ -cmake_minimum_required(VERSION 3.0) +#cmake_minimum_required(VERSION 3.0) +cmake_minimum_required(VERSION 2.8.11) link_directories ( "${CMAKE_CURRENT_SOURCE_DIR}/../install/lib" ) include_directories( "${CMAKE_CURRENT_SOURCE_DIR}/../install/include" ) diff --git a/example/example.cpp b/example/example.cpp index 693a3b0..45370dd 100644 --- a/example/example.cpp +++ b/example/example.cpp @@ -31,7 +31,7 @@ licenseLocation.environmentVariableName = ""; EVENT_TYPE result = acquire_license("example", licenseLocation, &licenseInfo); PcSignature signature; - FUNCTION_RETURN generate_ok = generate_user_pc_signature(signature, ETHERNET); + FUNCTION_RETURN generate_ok = generate_user_pc_signature(signature, DEFAULT); if (result == LICENSE_OK && licenseInfo.linked_to_pc) { CSimpleIniA ini; diff --git a/src/library/ini/SimpleIni.h b/src/library/ini/SimpleIni.h index 5b11f4f..ac703b2 100644 --- a/src/library/ini/SimpleIni.h +++ b/src/library/ini/SimpleIni.h @@ -2488,6 +2488,9 @@ bNeedNewLine = true; } + + // Append new empty line + a_oOutput.Write(SI_NEWLINE_A); return SI_OK; } diff --git a/src/library/os/os-linux.c b/src/library/os/os-linux.c index b4d9441..7869651 100644 --- a/src/library/os/os-linux.c +++ b/src/library/os/os-linux.c @@ -95,6 +95,7 @@ currentDrive = 0; while (NULL != (ent = getmntent(aFile))) { if ((strncmp(ent->mnt_type, "ext", 3) == 0 + || strncmp(ent->mnt_type, "xfs", 3) == 0 || strncmp(ent->mnt_type, "vfat", 4) == 0 || strncmp(ent->mnt_type, "ntfs", 4) == 0) && ent->mnt_fsname != NULL diff --git a/src/tools/license-generator/license-generator.cpp b/src/tools/license-generator/license-generator.cpp index f6efc9c..bbf8b0f 100644 --- a/src/tools/license-generator/license-generator.cpp +++ b/src/tools/license-generator/license-generator.cpp @@ -178,7 +178,7 @@ if (vm.count("output")) { const std::string fname = vm["output"].as<string>(); - fstream ofstream(fname, std::ios::out | std::ios::trunc); + fstream ofstream(fname, std::ios::out | std::ios::app); if (!ofstream.is_open()) { cerr << "can't open file [" << fname << "] for output." << endl << " error: " << strerror( errno); -- Gitblit v1.9.1