When I used gentoo, in this cases I downloaded the patch and put it in the files dir of ebuild in question, here glib, then I edited the ebuild to incorporate that patch, then I just re-emerge glib package.. Well firstly copy the glib ebuild dir to your overlay, so you have confidence your changes wont be overwrited in the next update.
I also remember you have to run a "ebuild $package manifest" or something like that so the ebuild recognizes the new patch file you've put in 'files' dir.. sorry I don't remember well the commands...
You can download the patch in question here:
http://svn.gnome.org/viewvc/glib/trunk/gio/gunixvolumemonitor.c?view=patch&r1=7274&r2=7273&pathrev=7274