GNOME Bugzilla – Bug 128719
[PATCH] Add basic FreeBSD support
Last modified: 2005-08-15 01:31:15 UTC
The attached patches add basic FreeBSD support to gnome-network. They mainly focus on the netinfo app. The one thing I know doesn't work is the interface stats. Everything else now works pretty well. Some things you'll notice in the code are I axed the MII stuff since that was highly Linux-specific. I think those ifdef's are pretty safe for Linux users, though, so no functionality lost on that end. I also fixed what I think is a universal bug that would cause netinfo to go into an infinite loop if G_IO_IN was set, but the input was NULL (i.e. G_IO_HUP was also set). Everything else is mainly just ifdef's to parse the various commands' output on FreeBSD. I hope these patches can be committed in some form, plus I hope you'll keep me (or freebsd-gnome@freebsd.org) in mind when future porting is required. All in all, this is a cool suite. Thanks.
Created attachment 22170 [details] [review] Add FreeBSD support
Created attachment 22171 [details] [review] Add FreeBSD support
Please ignore incomplete patch upload in attachment 22170 [details] [review]. Sorry.
Forgot one other thing. There is some string breakage in netstat.c. FreeBSD's netstat doesn't ouput a separate column for netmask, so I changed the header of the Destination column to be Destination/Prefix. I can upload an i18n patch for this if needed. Sorry.
The gnome-remote-shell part looks ok and has been committed to CVS. The rest, I'll leave that to Germán.
I think using memset is preferable to using bzero. Why do you change the socket from DGRAM to STREAM? We are not in string freeze so you should mark the new string for translation (if the string is actually necessary). Could you please update your patch? Thanks.
Okay, I thought there were some other bzero instances in the code. I'll use memset instead. Sorry about the SOCK_STREAM thing. That was from some _very_ early debugging, and somehow crept into the final patch. I'll remove it. How do I mark a string for translation? Thanks.
Created attachment 22529 [details] [review] Modified diff based on developer feedback
I fixed the diff to remove the SOCK_STREAM change, and use memset() in places where I introduced bzero(). If there was already a bzero(), I left it alone. As for the translatable string, I precluded it with the _(), but I'm not sure what else needs to be done to mark it for translation. Thanks.
That code (socket, connect, etc) should really be changed to use libgnetwork's socket interface.
Specifically, the GNetworkInterfaceInfo APIs...
Upgrading the priority to High due to the attached patches.
As for the new string, just doing _() is enough. The i18n tools (intltool) will do the rest.
Applied the last patch in CVS. I'll take a look to GNetworkInterfaceInfo and open a new bug if it worth.