Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

wrapper: clarify use of 'os' variable

The 'os' variable switches midway from representing the converted
Mac OS X major release number to representing the "reattach
variation" that we will are about to use. The former is (more or
less) a number, but the latter is really more of an enum.
  • Loading branch information...
commit 6ad067cf93d81ebba5c6650493b935c98380b2da 1 parent 51bbc9f
@ChrisJohnsen authored
Showing with 10 additions and 1 deletion.
  1. +10 −1 reattach-to-user-namespace.c
View
11 reattach-to-user-namespace.c
@@ -79,6 +79,15 @@ int main(int argc, char *argv[]) {
free(whole);
+ /*
+ * change the 'os' variable to represent the "reattach variation"
+ * instead of the major OS release
+ *
+ * < 10.5 => 1050 with warning
+ * 10.5 => 1050
+ * 10.6 => 1060
+ * > 10.6 => 1060 with warning
+ */
if (os < 1050) {
warn("unsupported old OS, trying as if it were 10.5");
os = 1050;
@@ -113,7 +122,7 @@ int main(int argc, char *argv[]) {
void *(*func)(uid_t, const char *, uint64_t) = f;
r = func(getuid(), bg, 0);
} else
- die(2, "unexpected OS, giving up");
+ die(2, "BUG: unhandled reattach variation: %u", os);
if (r)
die(2, "%s failed", fn);
Please sign in to comment.
Something went wrong with that request. Please try again.