setarch/setarch-sparc32bash.patch
Jindrich Novy a358fb5ef6 - add sparc32bash alias to keep compatibility with sparc32 which is
obsoleted by setarch for some time (#221976), thanks to Dennis Gilmore
2007-01-12 15:00:21 +00:00

26 lines
890 B
Diff

--- setarch-2.0/setarch.c.sparc32bash 2006-04-07 14:35:49.000000000 +0200
+++ setarch-2.0/setarch.c 2007-01-12 15:37:53.000000000 +0100
@@ -113,6 +113,7 @@
#endif
#if defined(__sparc64__) || defined(__sparc__)
{PER_LINUX32, "sparc", "sparc"},
+ {PER_LINUX32, "sparc32bash", "sparc"},
{PER_LINUX32, "sparc32", "sparc"},
{PER_LINUX, "sparc64", "sparc64"},
#endif
@@ -170,7 +171,14 @@
if (!strcmp(p, "-h") || !strcmp(p, "--help"))
show_help();
}
-
+#if defined(__sparc64__) || defined(__sparc__)
+ if (!strcmp(p, "sparc32bash")) {
+ if (set_arch(p, NULL))
+ error(EXIT_FAILURE, errno, "Failed to set personality to %s", p);
+ execl("/bin/bash", NULL);
+ error(EXIT_FAILURE, errno, "/bin/bash");
+ }
+#endif
for (argv++, argc--; argc && argv[0][0] == '-'; argv++, argc--) {
int n, unknown = 1;
const char *arg = argv[0];