Skip to content

Fix copy-paste bug in resource.getrusage(): ru_stime uses wrong field #5896

Closed
@coderabbitai

Description

@coderabbitai

Problem

In stdlib/src/resource.rs, the From<libc::rusage> for Rusage implementation has a copy-paste bug where the ru_stime field is incorrectly populated with rusage.ru_utime instead of rusage.ru_stime.

Impact

This bug affects the correctness of resource.getrusage() results on all platforms. The system time (ru_stime) is lost and user time (ru_utime) is duplicated.

Location

File: stdlib/src/resource.rs
Lines: ~94-96 in the From<libc::rusage> for Rusage implementation

Fix

Change:

ru_stime: tv(rusage.ru_utime),

To:

ru_stime: tv(rusage.ru_stime),

References

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    pFad - Phonifier reborn

    Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

    Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


    Alternative Proxies:

    Alternative Proxy

    pFad Proxy

    pFad v3 Proxy

    pFad v4 Proxy