Because negative value is returned on failure of lib_mode2offlags which converts the mode string into file open mode flag.