Submitted by: William Immendorf <will.immendorf@gmail.com>
Date: 2010-05-08
Inital Package Version: 8.5
Origion: Fedora CVS, used coreutils-8.2-uname-processortype.patch.
Upstream Status: Rejected
Description: Fixes uname's functionally once and for all. Unlike the old hacky patch, this one is cleaner and also fixes the functionally of -i as well as -p.
diff -Naur coreutils-8.5.orig/src/uname.c coreutils-8.5/src/uname.c
old
|
new
|
|
301 | 301 | |
302 | 302 | if (toprint & PRINT_PROCESSOR) |
303 | 303 | { |
304 | | char const *element = unknown; |
| 304 | char *element = unknown; |
305 | 305 | #if HAVE_SYSINFO && defined SI_ARCHITECTURE |
306 | 306 | { |
307 | 307 | static char processor[257]; |
308 | 308 | if (0 <= sysinfo (SI_ARCHITECTURE, processor, sizeof processor)) |
309 | 309 | element = processor; |
310 | 310 | } |
| 311 | #else |
| 312 | { |
| 313 | struct utsname u; |
| 314 | uname(&u); |
| 315 | element = u.machine; |
| 316 | } |
311 | 317 | #endif |
312 | 318 | #ifdef UNAME_PROCESSOR |
313 | 319 | if (element == unknown) |
… |
… |
|
345 | 351 | |
346 | 352 | if (toprint & PRINT_HARDWARE_PLATFORM) |
347 | 353 | { |
348 | | char const *element = unknown; |
| 354 | char *element = unknown; |
349 | 355 | #if HAVE_SYSINFO && defined SI_PLATFORM |
350 | 356 | { |
351 | 357 | static char hardware_platform[257]; |
… |
… |
|
353 | 359 | hardware_platform, sizeof hardware_platform)) |
354 | 360 | element = hardware_platform; |
355 | 361 | } |
| 362 | #else |
| 363 | { |
| 364 | struct utsname u; |
| 365 | uname(&u); |
| 366 | element = u.machine; |
| 367 | if(strlen(element)==4 && element[0]=='i' && element[2]=='8' && element[3]=='6') |
| 368 | element[1]='3'; |
| 369 | } |
356 | 370 | #endif |
357 | 371 | #ifdef UNAME_HARDWARE_PLATFORM |
358 | 372 | if (element == unknown) |