added errno varriable, access function fixed 2 compiler warnings