From: j-h.choi Date: Wed, 18 Mar 2020 01:39:29 +0000 (+0900) Subject: Modify the standard output and error in fprintf X-Git-Tag: accepted/tizen/5.5/unified/20200319.094222~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fb980797322b4a68c9d87a237aad182cf9f830e1;p=platform%2Fcore%2Fdotnet%2Flauncher.git Modify the standard output and error in fprintf Change-Id: Ib266a4833eccdfb63b30d9ff1b5dffb71858cb82 --- diff --git a/NativeLauncher/tool/ni_common.cc b/NativeLauncher/tool/ni_common.cc index 3a2a476..f57e8c5 100644 --- a/NativeLauncher/tool/ni_common.cc +++ b/NativeLauncher/tool/ni_common.cc @@ -71,7 +71,7 @@ static void waitInterval() { // by the recommand, ignore small value for performance. if (__interval > 10000) { - fprintf(stderr, "sleep %d usec\n", __interval); + fprintf(stdout, "sleep %d usec\n", __interval); usleep(__interval); } } @@ -335,7 +335,7 @@ static ni_error_e crossgen(const std::string& dllPath, const std::string& appPat argv.push_back(absDllPath.c_str()); argv.push_back(nullptr); - fprintf(stderr, "+ %s (%s)\n", absDllPath.c_str(), enableR2R ? "R2R" : "FNV"); + fprintf(stdout, "+ %s (%s)\n", absDllPath.c_str(), enableR2R ? "R2R" : "FNV"); execv(__CROSSGEN_PATH, const_cast(argv.data())); exit(0); @@ -372,14 +372,14 @@ static int appAotCb(pkgmgrinfo_appinfo_h handle, void *userData) fprintf(stderr, "Failed to generate NI file [%s]\n", pkgId); return -1; } else { - fprintf(stderr, "Complete make application to native image\n"); + fprintf(stdout, "Complete make application to native image\n"); } if (createTACPkgRoot(pkgId, *pFlags) != NI_ERROR_NONE) { fprintf(stderr, "Failed to generate symbolic link file [%s]\n", pkgId); return -1; }else { - fprintf(stderr, "Complete make symbolic link file to tac\n"); + fprintf(stdout, "Complete make symbolic link file to tac\n"); } return 0; @@ -413,7 +413,7 @@ ni_error_e initNICommon(NiCommonOption* option) const static std::string intervalFile = concatPath(__NATIVE_LIB_DIR, "crossgen_interval.txt"); std::ifstream inFile(intervalFile); if (inFile) { - fprintf(stderr, "crossgen_interval.txt is found\n"); + fprintf(stdout, "crossgen_interval.txt is found\n"); inFile >> __interval; } @@ -517,7 +517,7 @@ ni_error_e createTACPkgRoot(const std::string& pkgId, DWORD flags) std::string symNIPath = symPath.substr(0, symPath.rfind(".dll")) + ".ni.dll"; if (!bf::exists(symNIPath)) { bf::create_symlink(originNiPath, symNIPath); - fprintf(stderr, "%s symbolic link file generated successfully.\n", symNIPath.c_str()); + fprintf(stdout, "%s symbolic link file generated successfully.\n", symNIPath.c_str()); copySmackAndOwnership(tacDir.c_str(), symNIPath.c_str(), true); std::string niFileName = symNIPath.substr(symNIPath.rfind('/') + 1); @@ -620,7 +620,7 @@ ni_error_e createNiDllUnderPkgRoot(const std::string& pkgId, const std::string& std::string setNiPath = dllPath.substr(0, dllPath.rfind(".dll")) + ".ni.dll"; if (!bf::exists(setNiPath)) { bf::create_symlink(originNiPath, setNiPath); - fprintf(stderr, "%s symbolic link file generated successfully.\n", setNiPath.c_str()); + fprintf(stdout, "%s symbolic link file generated successfully.\n", setNiPath.c_str()); copySmackAndOwnership(tacDir.c_str(), setNiPath.c_str(), true); } std::string niFileName = setNiPath.substr(setNiPath.rfind('/') + 1); @@ -743,7 +743,7 @@ ni_error_e regenerateAppNI(DWORD flags) return NI_ERROR_UNKNOWN; } - fprintf(stderr, "Success pkgmgrinfo_appinfo_metadata_filter_foreach\n"); + fprintf(stdout, "Success pkgmgrinfo_appinfo_metadata_filter_foreach\n"); pkgmgrinfo_appinfo_metadata_filter_destroy(handle); return NI_ERROR_NONE; @@ -804,7 +804,7 @@ ni_error_e regenerateTACNI(DWORD flags) pkgmgrinfo_appinfo_metadata_filter_destroy(handle); return NI_ERROR_UNKNOWN; } - fprintf(stderr, "Success pkgmgrinfo_appinfo_metadata_filter_foreach\n"); + fprintf(stdout, "Success pkgmgrinfo_appinfo_metadata_filter_foreach\n"); pkgmgrinfo_appinfo_metadata_filter_destroy(handle); diff --git a/NativeLauncher/tool/tac_common.cc b/NativeLauncher/tool/tac_common.cc index 4c50abe..e2d59d8 100644 --- a/NativeLauncher/tool/tac_common.cc +++ b/NativeLauncher/tool/tac_common.cc @@ -175,7 +175,7 @@ tac_error_e restoreTACDB() pkgmgrinfo_appinfo_metadata_filter_destroy(handle); return TAC_ERROR_UNKNOWN; } - fprintf(stderr, "Success pkgmgrinfo_appinfo_metadata_filter_foreach\n"); + fprintf(stdout, "Success pkgmgrinfo_appinfo_metadata_filter_foreach\n"); pkgmgrinfo_appinfo_metadata_filter_destroy(handle); @@ -352,7 +352,7 @@ tac_error_e enableTACPackage(const std::string& pkgId) std::string originNIPath = originPath.substr(0, originPath.rfind(".dll")) + ".ni.dll"; if (bf::exists(originNIPath)) { bf::create_symlink(originNIPath, concatPath(tacDir, NIFileName)); - fprintf(stderr, "%s symbolic link file generated successfully.\n", concatPath(tacDir, NIFileName).c_str()); + fprintf(stdout, "%s symbolic link file generated successfully.\n", concatPath(tacDir, NIFileName).c_str()); copySmackAndOwnership(tacDir.c_str(), concatPath(tacDir, NIFileName).c_str(), true); if (!removeFile(concatPath(binNIDir, NIFileName))) { @@ -362,7 +362,7 @@ tac_error_e enableTACPackage(const std::string& pkgId) } } bf::create_symlink(originPath, concatPath(tacDir, fileName)); - fprintf(stderr, "%s symbolic link file generated successfully.\n", concatPath(tacDir, fileName).c_str()); + fprintf(stdout, "%s symbolic link file generated successfully.\n", concatPath(tacDir, fileName).c_str()); copySmackAndOwnership(tacDir.c_str(), concatPath(tacDir, fileName).c_str(), true); if (!removeFile(concatPath(binDir, fileName))) {