From cb317944e36b6fa1b68abe80fa1e54270f3a0840 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Mon, 13 May 2019 10:39:33 +0200 Subject: change "i686" to "pentium4" if sse2 is available --- src/pacman/pacman.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/pacman/pacman.c') diff --git a/src/pacman/pacman.c b/src/pacman/pacman.c index 3bb622e6..abb6f933 100644 --- a/src/pacman/pacman.c +++ b/src/pacman/pacman.c @@ -274,8 +274,15 @@ static void setuseragent(void) int len; uname(&un); + char machine[8]; + strncpy(machine, un.machine, 8); + if(strcmp(machine, "i686") == 0) { + __builtin_cpu_init(); + if (__builtin_cpu_supports("sse2")) + strncpy(machine, "pentium4", 8); + } len = snprintf(agent, 100, "pacman/%s (%s %s) libalpm/%s", - PACKAGE_VERSION, un.sysname, un.machine, alpm_version()); + PACKAGE_VERSION, un.sysname, machine, alpm_version()); if(len >= 100) { pm_printf(ALPM_LOG_WARNING, _("HTTP_USER_AGENT truncated\n")); } -- cgit v1.2.3-54-g00ecf