tuhaihe commented on code in PR #1589:
URL: https://github.com/apache/cloudberry/pull/1589#discussion_r2871428349
##########
src/bin/initdb/initdb.c:
##########
@@ -2054,11 +2056,18 @@ setup_cdb_schema(FILE *cmdfd)
errno = 0;
#endif
- closedir(dir);
+ readdir_errno = errno;
+
+ if (closedir(dir))
Review Comment:
Thanks for the review! I've updated the code to follow the pattern used in
src/bin/pg_rewind/file_ops.c - checking the readdir error first before calling
closedir. This ensures no error information is lost. See commit
https://github.com/apache/cloudberry/pull/1589/commits/f91837baa26deca5a4aa56174a7ffebf07dbb5e3
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]