ywkaras commented on code in PR #11526:
URL: https://github.com/apache/trafficserver/pull/11526#discussion_r1670925929


##########
src/tscore/ink_file.cc:
##########
@@ -42,6 +42,21 @@ using ioctl_arg_t = union {
   off_t    off;
 };
 
+/** Open and possibly create a file.
+ *
+ * This is a wrapper for the POSIX open() call that will retry the call if a
+ * transient error occurs.
+ */
+int
+safe_open(char const *path, int oflag, mode_t mode)
+{
+  int r{-1};
+  do {
+    r = open(path, oflag, mode);
+  } while ((r < 0) && (errno == EINTR));
+  return r;
+}
+

Review Comment:
   I'm not sure why this was originally inlined in the header.  But remember 
that functions declared with inline are not necessarily inlined.  If the 
compiler considers it non-optimal to actually inline, if will put the function 
in a vague linkage section, which prevents multiple copies of it from being 
present in the linked executable:  
https://gcc.gnu.org/onlinedocs/gcc/Vague-Linkage.html .



-- 
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: github-unsubscr...@trafficserver.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to