Bug 340
| Summary: | procps-1.2.9 bug fix - sorting in reverse order w/short options | ||
|---|---|---|---|
| Product: | [Retired] Red Hat Linux | Reporter: | prince |
| Component: | procps | Assignee: | Michael K. Johnson <johnsonm> |
| Status: | CLOSED CURRENTRELEASE | QA Contact: | |
| Severity: | medium | Docs Contact: | |
| Priority: | medium | ||
| Version: | 5.2 | CC: | prince, procps-bugs |
| Target Milestone: | --- | ||
| Target Release: | --- | ||
| Hardware: | All | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | Bug Fix | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 1999-05-16 21:47:15 UTC | Type: | --- |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
Will be fixed in procps 1.2.10 or procps 2.0.x, whichever comes first. |
The Problem =========== Sorting in reverse order with short options didn't work. Also, sorting in unreversed order didn't work if the optional '+' was specified. Example: generate a list of processes sorted in order by pid. The following two commands should generate identical results, but didn't. ps auxOp ps auxO+p The Solution ============ Fix one file, proc/compare.c, as follows, to remove the offending line. Of course, you can just delete the offending line rather than comment it out as I've done here. mystic:/usr/src/redhat/BUILD/procps-1.2.9/proc $ diff -u compare_old.c compare.c --- compare_old.c Mon Dec 7 00:09:23 1998 +++ compare.c Sun Dec 6 23:44:37 1998 @@ -226,7 +226,15 @@ if (*opt == '-' || *opt == '+') { if (*opt == '-') next_dir = -1; + /* [prince] Sun Dec 6 23:38:15 PST 1998 + The commands "ps -auxOp" and "ps -auxO+p" should produce + identical results, but they don't because this function + incorrectly skips the character after the '-' or '+' in + short option lists. The '++opt' in the for () statement will + skip past the '-' or '+' anyway. + Old Code: opt++; + End Old Code */ continue; } for (i = 0; cmp[i].letter; i++)