Github user paul-guo- commented on a diff in the pull request: https://github.com/apache/incubator-hawq/pull/1157#discussion_r103856229 --- Diff: src/backend/executor/nodeShareInputScan.c --- @@ -627,38 +627,50 @@ static void create_tmp_fifo(const char *fifoname) /* * As all other read/write in postgres, we may be interrupted so retry is needed. */ -static int retry_read(int fd, char *buf, int rsize) +static int retry_read(int *fd, char *buf, int rsize) { int sz; Assert(rsize > 0); read_retry: - sz = read(fd, buf, rsize); + sz = read(*fd, buf, rsize); --- End diff -- Frankly speaking, I'd retry_read() logic simple like this: do { err =read(fd, buf, rsize); } while (err == -1 && errno == EINTR); And leave close() and error handling code in callers of it. If you insist on this, at least you could modify the function name to reflect the additional close() call and exiting. I do not why a fd pointer is needed here since elog(ERROR, ...) will quit the progress. The comment applies to the write change below also.
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---