summaryrefslogtreecommitdiffstats
path: root/src/corelib/io/qlockfile_unix.cpp
diff options
context:
space:
mode:
authorAhmad Samir <a.samirh78@gmail.com>2023-03-08 22:07:46 +0200
committerAhmad Samir <a.samirh78@gmail.com>2023-04-08 13:24:04 +0200
commit7191b8fe38788ac57e15e4124955c3cd8333d858 (patch)
treecedf6592e8b88c5e73c352caf6fa412314839da3 /src/corelib/io/qlockfile_unix.cpp
parentdb797d19a3721bedc0d6b1f179e5e32621be277a (diff)
Fix some narrowing conversion warnings
ioctl call for FIONREAD takes an int arg, it won't work correctly otherwise. Cast the return of the read() call to int, because it won't read more than buffSize (which is an int). Change-Id: I130202a732684257bbb0e79c9358b60a61010c46 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/io/qlockfile_unix.cpp')
-rw-r--r--src/corelib/io/qlockfile_unix.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/corelib/io/qlockfile_unix.cpp b/src/corelib/io/qlockfile_unix.cpp
index 34aa3b65ec..47aff8b973 100644
--- a/src/corelib/io/qlockfile_unix.cpp
+++ b/src/corelib/io/qlockfile_unix.cpp
@@ -170,7 +170,7 @@ bool QLockFilePrivate::removeStaleLock()
bool QLockFilePrivate::isProcessRunning(qint64 pid, const QString &appname)
{
- if (::kill(pid, 0) == -1 && errno == ESRCH)
+ if (::kill(pid_t(pid), 0) == -1 && errno == ESRCH)
return false; // PID doesn't exist anymore
const QString processName = processNameByPid(pid);