提交 fb5cd7f8 编写于 作者: L Liu Yiqun

Refine the error logs.

上级 7c8e5c3b
...@@ -7,14 +7,17 @@ ...@@ -7,14 +7,17 @@
do { \ do { \
paddle_error __err__ = stmt; \ paddle_error __err__ = stmt; \
if (__err__ != kPD_NO_ERROR) { \ if (__err__ != kPD_NO_ERROR) { \
fprintf(stderr, "Invoke paddle error %d \n" #stmt, __err__); \ fprintf(stderr, "Invoke paddle error %d in " #stmt "\n", __err__); \
exit(__err__); \ exit(__err__); \
} \ } \
} while (0) } while (0)
void* read_config(const char* filename, long* size) { void* read_config(const char* filename, long* size) {
FILE* file = fopen(filename, "r"); FILE* file = fopen(filename, "r");
if (file == NULL) return NULL; if (file == NULL) {
fprintf(stderr, "Open %s error\n", filename);
return NULL;
}
fseek(file, 0L, SEEK_END); fseek(file, 0L, SEEK_END);
*size = ftell(file); *size = ftell(file);
fseek(file, 0L, SEEK_SET); fseek(file, 0L, SEEK_SET);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册