You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by jp...@apache.org on 2012/11/03 04:29:06 UTC
[1/2] git commit: TS-207: Fix the Darwin build
Updated Branches:
refs/heads/master a613da984 -> 437fd0148
TS-207: Fix the Darwin build
Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/437fd014
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/437fd014
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/437fd014
Branch: refs/heads/master
Commit: 437fd01484fccfa1da5f7841f35188714e990538
Parents: 46fa49e
Author: James Peach <jp...@apache.org>
Authored: Fri Nov 2 20:28:57 2012 -0700
Committer: James Peach <jp...@apache.org>
Committed: Fri Nov 2 20:28:57 2012 -0700
----------------------------------------------------------------------
iocore/cache/Store.cc | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/437fd014/iocore/cache/Store.cc
----------------------------------------------------------------------
diff --git a/iocore/cache/Store.cc b/iocore/cache/Store.cc
index dd84298..2935f53 100644
--- a/iocore/cache/Store.cc
+++ b/iocore/cache/Store.cc
@@ -444,6 +444,8 @@ Span::init(char *an, int64_t size)
case S_IFBLK:{
case S_IFCHR:
+ // These IOCTLs are standard across the BSD family; Darwin has a different set though.
+#if defined(DIOCGMEDIASIZE) && defined(DIOCGSECTORSIZE)
if (ioctl(fd, DIOCGMEDIASIZE, &size) < 0) {
Warning("unable to get disk information for '%s': %s", n, strerror(errno));
err = "unable to get label information";
@@ -456,6 +458,11 @@ Span::init(char *an, int64_t size)
}
devnum = s.st_rdev;
break;
+#else
+ Warning("unable to get disk information for '%s': %s", n, strerror(errno));
+ err = "no raw disk support on this platform";
+ goto Lfail;
+#endif
}
case S_IFDIR:
case S_IFREG: