fix readdir example on Solaris, where type is nil