added BSD ifdefs and changes for TSP return code logging
added BSD ifdefs and changes for TSP return code logging

emilcondrea/trousers,emilcondrea/trousers,Distrotech/trousers,Distrotech/trousers,Distrotech/trousers,emilcondrea/trousers