diff options
-rw-r--r-- | debian/changelog | 7 | ||||
-rw-r--r-- | ischroot.c | 20 |
2 files changed, 27 insertions, 0 deletions
diff --git a/debian/changelog b/debian/changelog index 7a861f6..21fae1d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +debianutils (4.3.4+dyson1) unstable; urgency=low + + * Package for Dyson + * ischroot() now supports illumos/solaris (like on linux) + + -- Igor Pashev <pashev.igor@gmail.com> Tue, 30 Apr 2013 03:55:35 +0400 + debianutils (4.3.4) unstable; urgency=low [ David Prévot ] @@ -152,6 +152,26 @@ static int ischroot() return 0; } +#elif defined (__sun__) + +/* Similar to Linux + * XXX: check zone? + * XXX: illumos kernel automatically mounts /proc on boot + */ + +static int ischroot() +{ + struct stat st1, st2; + + if (stat("/", &st1)) + return 2; + if (stat("/proc/1/root", &st2)) + return 2; + if ((st1.st_dev == st2.st_dev) && (st1.st_ino == st2.st_ino)) + return 1; + return 0; +} + #else static int ischroot() |