Re: iphlpapi: Intel Mac do not implement /proc filesystem so return Unimplemented for the functions trying to read from there.
Hi Aric, @@ -104,6 +104,9 @@ DWORD getInterfaceStatsByName(const char { FILE *fp; +#ifdef __APPLE__ + return ERROR_NOT_SUPPORTED; +#endif This is ugly. Why not just change the case when fp is NULL? You've already got: fp = fopen("/proc/net/dev", "r"); if (fp) { ... } else ERR ("unimplemented!\n"); You could change this to set the return value, rather than using all these #ifdefs. Same thing throughout the patch. --Juan
Yeah after I submitted the patch, I was thinking about that as well. I will look at doing that. -aric Juan Lang wrote:
Hi Aric,
@@ -104,6 +104,9 @@ DWORD getInterfaceStatsByName(const char { FILE *fp;
+#ifdef __APPLE__ + return ERROR_NOT_SUPPORTED; +#endif
This is ugly. Why not just change the case when fp is NULL? You've already got: fp = fopen("/proc/net/dev", "r"); if (fp) { ... } else ERR ("unimplemented!\n");
You could change this to set the return value, rather than using all these #ifdefs. Same thing throughout the patch. --Juan
participants (2)
-
Aric Stewart -
Juan Lang