Removed static to get rid of the errors, and changed the error check to use errno instead of the result from mkdir.