Merge "use smart pointer for fd" into main