mkstemp usage patch