ithewei 6 years ago
parent
commit
1b80744704
2 changed files with 4 additions and 2 deletions
  1. 3 1
      herr.h
  2. 1 1
      hlog.cpp

+ 3 - 1
herr.h

@@ -33,7 +33,9 @@
     F(ERR_SAVE_FILE,        1201,   "save file failed") \
     \
     F(ERR_OUT_OF_RANGE,     1300,   "out of range")     \
-    F(ERR_OVER_LIMIT,       1301,   "over limit")
+    F(ERR_OVER_LIMIT,       1301,   "over limit")       \
+    \
+    F(ERR_BUSY,             1400,   "busy")
 
 #define FOREACH_ERR_NETWORK(F) \
     F(ERR_ADAPTER_NOT_FOUND,    2001, "adapter not found")  \

+ 1 - 1
hlog.cpp

@@ -124,7 +124,7 @@ int hlog_printf(int level, const char* fmt, ...) {
     else {
         fprintf(fp, "%s\n", s_logbuf);
     }
-    //fflush(fp); // note: fflush cache page => disk, slow
+    fflush(fp); // note: fflush cache page => disk, slow
 
     return len;
 }