A message regarding the use of -d was being printed under incorrect conditions due to an error status not being checked.