diff --git a/linux/LinuxProcess.c b/linux/LinuxProcess.c index c20397964..dc4f2594d 100644 --- a/linux/LinuxProcess.c +++ b/linux/LinuxProcess.c @@ -196,13 +196,10 @@ static bool LinuxProcess_changeAutogroupPriorityBy(Process* p, Arg delta) { long int identity; int nice; int ok = fscanf(file, "/autogroup-%ld nice %d", &identity, &nice); - bool success; - if (ok == 2) { - rewind(file); + bool success = false; + if (ok == 2 && fseek(file, 0L, SEEK_SET) == 0) { xSnprintf(buffer, sizeof(buffer), "%d", nice + delta.i); success = fputs(buffer, file) > 0; - } else { - success = false; } fclose(file);