提交 e51a7346 编写于 作者: H hanyuhang

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.
上级 603847b8
......@@ -21,8 +21,6 @@
#include <errno.h>
#include <sys/types.h>
#include <limits.h>
/* 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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册