From e51a7346de3da576674d2c65fb9c17c0d28bf032 Mon Sep 17 00:00:00 2001 From: hanyuhang Date: Thu, 13 Aug 2020 11:39:08 +0800 Subject: [PATCH] revert AipGen.cpp: genAttributesTemplate and genEncoderImpl are the function which are used to generate relative .h file,if they are modifed as canonical rule,sometimes will not generate relative file. --- .../host/tools/emugen/ApiGen.cpp | 24 ++++--------------- 1 file changed, 5 insertions(+), 19 deletions(-) diff --git a/external/android-emugl/host/tools/emugen/ApiGen.cpp b/external/android-emugl/host/tools/emugen/ApiGen.cpp index 142bf0e4..2757d8b3 100644 --- a/external/android-emugl/host/tools/emugen/ApiGen.cpp +++ b/external/android-emugl/host/tools/emugen/ApiGen.cpp @@ -21,8 +21,6 @@ #include #include -#include - /* Define this to 1 to enable support for the 'isLarge' variable flag * that instructs the encoder to send large data buffers by a direct * write through the pipe (i.e. without copying it into a temporary @@ -288,15 +286,9 @@ int ApiGen::genOpcodes(const std::string &filename) } int ApiGen::genAttributesTemplate(const std::string &filename ) { - const char* untrustPath = filename.c_str(); - char path[PATH_MAX] = {0}; - if(realpath(untrustPath, path) == NULL) { - return -1; - } - - FILE *fp = fopen(path, "wt"); + FILE *fp = fopen(filename.c_str(), "wt"); if (fp == NULL) { - perror(path); + perror(filename.c_str()); return -1; } @@ -462,15 +454,9 @@ static void writeEncodingChecksumValidatorOnReturn(const char* funcName, FILE* f int ApiGen::genEncoderImpl(const std::string &filename) { - const char* untrustPath = filename.c_str(); - char path[PATH_MAX] = {0}; - if(realpath(untrustPath, path) == NULL) { - return -1; - } - - FILE *fp = fopen(path, "wt"); + FILE *fp = fopen(filename.c_str(), "wt"); if (fp == NULL) { - perror(path); + perror(filename.c_str()); return -1; } @@ -1347,7 +1333,7 @@ int ApiGen::readAttributes(const std::string & attribFilename) break; } } - + fclose(fp); return 0; } -- GitLab