diff options
-rw-r--r-- | coreutils/uname.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/coreutils/uname.c b/coreutils/uname.c index 3809835a4..b4827de25 100644 --- a/coreutils/uname.c +++ b/coreutils/uname.c | |||
@@ -68,15 +68,17 @@ | |||
68 | /* After libbb.h, since it needs sys/types.h on some systems */ | 68 | /* After libbb.h, since it needs sys/types.h on some systems */ |
69 | #include <sys/utsname.h> | 69 | #include <sys/utsname.h> |
70 | 70 | ||
71 | #if ENABLE_PLATFORM_MINGW32 | ||
72 | # define OSNAME "MS/Windows" | ||
73 | #else | ||
74 | # define OSNAME "GNU/Linux" | ||
75 | #endif | ||
76 | |||
71 | typedef struct { | 77 | typedef struct { |
72 | struct utsname name; | 78 | struct utsname name; |
73 | char processor[sizeof(((struct utsname*)NULL)->machine)]; | 79 | char processor[sizeof(((struct utsname*)NULL)->machine)]; |
74 | char platform[sizeof(((struct utsname*)NULL)->machine)]; | 80 | char platform[sizeof(((struct utsname*)NULL)->machine)]; |
75 | #if ENABLE_PLATFORM_MINGW32 | 81 | char os[sizeof(OSNAME)]; |
76 | char os[sizeof("MS/Windows")]; | ||
77 | #else | ||
78 | char os[sizeof("GNU/Linux")]; | ||
79 | #endif | ||
80 | } uname_info_t; | 82 | } uname_info_t; |
81 | 83 | ||
82 | static const char options[] ALIGN1 = "snrvmpioa"; | 84 | static const char options[] ALIGN1 = "snrvmpioa"; |
@@ -143,11 +145,7 @@ int uname_main(int argc UNUSED_PARAM, char **argv) | |||
143 | #endif | 145 | #endif |
144 | strcpy(uname_info.processor, unknown_str); | 146 | strcpy(uname_info.processor, unknown_str); |
145 | strcpy(uname_info.platform, unknown_str); | 147 | strcpy(uname_info.platform, unknown_str); |
146 | #if ENABLE_PLATFORM_MINGW32 | 148 | strcpy(uname_info.os, OSNAME); |
147 | strcpy(uname_info.os, "MS/Windows"); | ||
148 | #else | ||
149 | strcpy(uname_info.os, "GNU/Linux"); | ||
150 | #endif | ||
151 | #if 0 | 149 | #if 0 |
152 | /* Fedora does something like this */ | 150 | /* Fedora does something like this */ |
153 | strcpy(uname_info.processor, uname_info.name.machine); | 151 | strcpy(uname_info.processor, uname_info.name.machine); |