I'd change it to if (rc > 0) return rc; then return rc; outside the else at the bottom.  (cosmetic)