1581N/A-/* Copyright (c) 2008, Oracle
and/or its affiliates. All rights reserved.
1581N/A+/* Copyright (c) 2008, 2015 Oracle
and/or its affiliates. All rights reserved.
1581N/A * Permission is hereby granted, free of charge, to any person obtaining a
1581N/A * copy of this software and associated documentation files (the "Software"),
1581N/A #if defined(__i386__) || defined(__i386) || defined(__x86)
1581N/A+ if (user_id != 0) { /* reset privs back to root */
1581N/A+ xf86Msg(X_WARNING, "Error in resetting euid to root \n");
1581N/A if (sysi86(SI86V86, V86SC_IOPL, PS_IOPL) < 0) {
1581N/A xf86Msg(X_WARNING, "xf86EnableIOPorts: Failed to set IOPL for I/O\n");
1581N/A+ if (user_id != 0) { /* reset privs back to user */
1581N/A+ if (seteuid(user_id) < 0) {
1581N/A+ xf86Msg(X_WARNING, "Error in resetting euid to %d\n", user_id);
1581N/A- sysi86(SI86V86, V86SC_IOPL, 0);
1581N/A+ if (sysi86(SI86V86, V86SC_IOPL, 0) < 0 )
1581N/A+ xf86Msg(X_WARNING, "xf86DisableIOPorts: Failed to set IOPL for I/O\n");