commit:     c51e1059c8def94a90a2976ae9d5a86f73df07b7
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Tue Dec 23 08:11:46 2025 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Tue Dec 23 08:11:46 2025 +0000
URL:        https://gitweb.gentoo.org/proj/steve.git/commit/?id=c51e1059

Use signed integers for job count, to avoid wraparound issues

Use signed integers throughout.  Admittedly, that's not the prettiest
solution possible but it's the easiest way to avoid conversion issues.

Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 src/steve.cxx | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/steve.cxx b/src/steve.cxx
index 7ec39bb..a9239ba 100644
--- a/src/steve.cxx
+++ b/src/steve.cxx
@@ -105,8 +105,8 @@ struct steve_state {
        int retval{0};
        const char *dev_name{"steve"};
        bool verbose;
-       uint64_t jobs;
-       uint64_t min_jobs{1};
+       int64_t jobs;
+       int64_t min_jobs{1};
        int64_t per_process_limit;
        double max_load_avg{-1};  /* < 0 implies no load average */
        double load_avg;
@@ -785,7 +785,7 @@ static void steve_ioctl(
                        steve_wake_waiters(state);
                        break;
                case STEVE_IOC_SET_MIN_JOBS:
-                       if (static_cast<uint64_t>(val) > state->jobs) {
+                       if (val > state->jobs) {
                                fuse_reply_err(req, EINVAL);
                                return;
                        }

Reply via email to