diff options
author | Igor Pashev <pashev.igor@gmail.com> | 2013-04-30 03:56:44 +0400 |
---|---|---|
committer | Igor Pashev <pashev.igor@gmail.com> | 2013-04-30 03:56:44 +0400 |
commit | da037d7196537768294130227dc0515392d97211 (patch) | |
tree | c8bc673263463921d9fd5f1946dabb180e3f254f | |
parent | 8fb496f15292ac92beeab0057329442e3d443052 (diff) | |
download | debianutils-da037d7196537768294130227dc0515392d97211.tar.gz |
* Package for Dyson
* ischroot() now supports illumos/solaris (like on linux)
-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() |