diff options
| author | Elliot Saba | 2010-10-13 13:42:32 -0700 |
|---|---|---|
| committer | Adam Vandenberg | 2010-10-16 17:57:33 -0700 |
| commit | f3fdd022956204ed15a291cbdefba378c3d5345e (patch) | |
| tree | 368a152a746f775e16d32a6be40758dd2e1ee3ec /Library | |
| parent | b6b6f58c1092b8eb1ba2f7d231053902f2e7d5d9 (diff) | |
| download | homebrew-f3fdd022956204ed15a291cbdefba378c3d5345e.tar.bz2 | |
ifstat, with patch to run on 64bit as well
Signed-off-by: Adam Vandenberg <flangy@gmail.com>
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Formula/ifstat.rb | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/Library/Formula/ifstat.rb b/Library/Formula/ifstat.rb new file mode 100644 index 000000000..955a8aecb --- /dev/null +++ b/Library/Formula/ifstat.rb @@ -0,0 +1,44 @@ +require 'formula' + +class Ifstat <Formula + url 'http://gael.roualland.free.fr/ifstat/ifstat-1.1.tar.gz' + homepage 'http://gael.roualland.free.fr/ifstat/' + md5 'b655642c33a626cfe976792fbcd9b6e1' + + def patches + #Fixes 32/64 bit incompatibility for snow leopard + DATA + end + + def install + system "./configure", "--disable-debug", "--disable-dependency-tracking", + "--prefix=#{prefix}", "--mandir=#{man}" + system "make install" + end +end + +__END__ +diff --git a/drivers.c b/drivers.c +index d5ac501..47fb320 100644 +--- a/drivers.c ++++ b/drivers.c +@@ -593,7 +593,8 @@ static int get_ifcount() { + int ifcount[] = { + CTL_NET, PF_LINK, NETLINK_GENERIC, IFMIB_SYSTEM, IFMIB_IFCOUNT + }; +- int count, size; ++ int count; ++ size_t size; + + size = sizeof(count); + if (sysctl(ifcount, sizeof(ifcount) / sizeof(int), &count, &size, NULL, 0) < 0) { +@@ -607,7 +608,7 @@ static int get_ifdata(int index, struct ifmibdata * ifmd) { + int ifinfo[] = { + CTL_NET, PF_LINK, NETLINK_GENERIC, IFMIB_IFDATA, index, IFDATA_GENERAL + }; +- int size = sizeof(*ifmd); ++ size_t size = sizeof(*ifmd); + + if (sysctl(ifinfo, sizeof(ifinfo) / sizeof(int), ifmd, &size, NULL, 0) < 0) + return 0; + |
