Fix compile warnings

use D_DEFAULT_SOURCE instead of D_BSD_SOURCE