If the intention is to handle "empty" pidfiles, then the "empty" case needs to be called out explicitly. This would then provide a clear definition of what an "empty" pidfile is (just the empty string? A string of just whitespace?). It would also then give an explicit path for what to do when the pidfile contains garbage (such as @adrienthebo's example).