SolidWallOfCode commented on a change in pull request #7818:
URL: https://github.com/apache/trafficserver/pull/7818#discussion_r631530598



##########
File path: iocore/aio/AIO.cc
##########
@@ -379,18 +379,15 @@ aio_queue_req(AIOCallbackInternal *op, int fromAPI = 0)
 static inline int
 cache_op(AIOCallbackInternal *op)
 {
-  bool read = (op->aiocb.aio_lio_opcode == LIO_READ);
+  typedef ssize_t (*p)(int, void*, size_t, __off_t);
+  p action=(op->aiocb.aio_lio_opcode == LIO_READ)?pread:(p)pwrite;
   for (; op; op = (AIOCallbackInternal *)op->then) {

Review comment:
       Because the signatures of `pread` and `pwrite` are slightly different 
(`void *` vs. `void const*`) and therefore `pwrite` must be cast to the `pread` 
signature type.  The `(p)` is a C-style cast.




-- 
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.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to