This is an automated email from the ASF dual-hosted git repository.
dmeden pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git
The following commit(s) were added to refs/heads/master by this push:
new 6ac1278580 CID-1550425: Mute coverity. Overflowed return value (#11798)
6ac1278580 is described below
commit 6ac1278580a19676f66ad77008a0779d3ed0c23a
Author: Damian Meden <[email protected]>
AuthorDate: Wed Oct 2 09:27:34 2024 +0200
CID-1550425: Mute coverity. Overflowed return value (#11798)
---
include/tscore/ink_sock.h | 3 ++-
src/tscore/ink_sock.cc | 4 ++--
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/include/tscore/ink_sock.h b/include/tscore/ink_sock.h
index 55148f9115..e6b8838449 100644
--- a/include/tscore/ink_sock.h
+++ b/include/tscore/ink_sock.h
@@ -29,6 +29,7 @@
***************************************************************************/
#pragma once
+#include <cstdint>
#include "tscore/ink_platform.h"
#include "tscore/ink_apidefs.h"
@@ -64,7 +65,7 @@ setsockopt_off(int s, int level, int optname)
* the file descriptor. If -1 is returned, errno should indicate why the
* write failed.
*/
-int safe_write(int fd, const char *buffer, int len);
+std::int64_t safe_write(int fd, const char *buffer, int len);
int safe_fcntl(int fd, int cmd, int arg);
int safe_ioctl(int fd, int request, char *arg);
diff --git a/src/tscore/ink_sock.cc b/src/tscore/ink_sock.cc
index 3b87f38abd..ecf658bca8 100644
--- a/src/tscore/ink_sock.cc
+++ b/src/tscore/ink_sock.cc
@@ -115,10 +115,10 @@ safe_clr_fl(int fd, int arg)
return flags;
}
-int
+std::int64_t
safe_write(int fd, const char *buffer, int len)
{
- int num_written = 0;
+ std::int64_t num_written = 0;
while (num_written < len) {
int const ret = write(fd, buffer + num_written, len - num_written);
if (ret == -1) {