summaryrefslogtreecommitdiffstats
path: root/src/corelib/io/qfilesystemengine_unix.cpp
diff options
context:
space:
mode:
authorAhmad Samir <a.samirh78@gmail.com>2023-03-08 13:12:40 +0200
committerAhmad Samir <a.samirh78@gmail.com>2023-03-11 12:39:41 +0200
commitdda60cf0d1c70f186845e5bfd08dca1cd5e98a93 (patch)
treea2ba7e2b8efacfc71af964430c76cfb5be48c3ec /src/corelib/io/qfilesystemengine_unix.cpp
parent7ffa0d3be59eeed8416713c82f424f3fda6c926e (diff)
sysconf() system function returns long
Change-Id: Ia7218c1cc0e8ec55822aee55d7643d6df48efa8b Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/io/qfilesystemengine_unix.cpp')
-rw-r--r--src/corelib/io/qfilesystemengine_unix.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/corelib/io/qfilesystemengine_unix.cpp b/src/corelib/io/qfilesystemengine_unix.cpp
index 3f07523f81..9909afaba7 100644
--- a/src/corelib/io/qfilesystemengine_unix.cpp
+++ b/src/corelib/io/qfilesystemengine_unix.cpp
@@ -764,7 +764,7 @@ QByteArray QFileSystemEngine::id(int fd)
QString QFileSystemEngine::resolveUserName(uint userId)
{
#if QT_CONFIG(thread) && defined(_POSIX_THREAD_SAFE_FUNCTIONS) && !defined(Q_OS_OPENBSD)
- int size_max = sysconf(_SC_GETPW_R_SIZE_MAX);
+ long size_max = sysconf(_SC_GETPW_R_SIZE_MAX);
if (size_max == -1)
size_max = 1024;
QVarLengthArray<char, 1024> buf(size_max);
@@ -790,7 +790,7 @@ QString QFileSystemEngine::resolveUserName(uint userId)
QString QFileSystemEngine::resolveGroupName(uint groupId)
{
#if QT_CONFIG(thread) && defined(_POSIX_THREAD_SAFE_FUNCTIONS) && !defined(Q_OS_OPENBSD)
- int size_max = sysconf(_SC_GETPW_R_SIZE_MAX);
+ long size_max = sysconf(_SC_GETPW_R_SIZE_MAX);
if (size_max == -1)
size_max = 1024;
QVarLengthArray<char, 1024> buf(size_max);
@@ -806,7 +806,7 @@ QString QFileSystemEngine::resolveGroupName(uint groupId)
struct group entry;
// Some large systems have more members than the POSIX max size
// Loop over by doubling the buffer size (upper limit 250k)
- for (unsigned size = size_max; size < 256000; size += size)
+ for (long size = size_max; size < 256000; size += size)
{
buf.resize(size);
// ERANGE indicates that the buffer was too small