[Groonga-commit] groonga/groonga at 85fd895 [master] Save the correct errno for strerror() is failed

Back to archive index

Kouhei Sutou null+****@clear*****
Sat Jan 10 13:10:10 JST 2015


Kouhei Sutou	2015-01-10 13:10:10 +0900 (Sat, 10 Jan 2015)

  New Revision: 85fd895f87f5f82cb6f7a166ba23c9290f983242
  https://github.com/groonga/groonga/commit/85fd895f87f5f82cb6f7a166ba23c9290f983242

  Message:
    Save the correct errno for strerror() is failed

  Modified files:
    lib/grn_ctx.h

  Modified: lib/grn_ctx.h (+3 -2)
===================================================================
--- lib/grn_ctx.h    2015-01-10 13:09:08 +0900 (b85b551)
+++ lib/grn_ctx.h    2015-01-10 13:10:10 +0900 (789b436)
@@ -337,7 +337,8 @@ GRN_API void grn_ctx_impl_set_current_error_message(grn_ctx *ctx);
 #else /* WIN32 */
 #define SERR(str) do {\
   grn_rc rc;\
-  switch (errno) {\
+  int errno_keep = errno;\
+  switch (errno_keep) {\
   case ELOOP : rc = GRN_TOO_MANY_SYMBOLIC_LINKS; break;\
   case ENAMETOOLONG : rc = GRN_FILENAME_TOO_LONG; break;\
   case ENOENT : rc = GRN_NO_SUCH_FILE_OR_DIRECTORY; break;\
@@ -385,7 +386,7 @@ GRN_API void grn_ctx_impl_set_current_error_message(grn_ctx *ctx);
   case EAGAIN: rc = GRN_OPERATION_WOULD_BLOCK; break;\
   default : rc = GRN_UNKNOWN_ERROR; break;\
   }\
-  ERR(rc, "syscall error '%s' (%s)[%d]", str, strerror(errno), errno);\
+  ERR(rc, "syscall error '%s' (%s)[%d]", str, strerror(errno_keep), errno_keep);\
 } while (0)
 
 #define SOERR(str) SERR(str)
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index