• Pavel Emelyanov's avatar
    fd: Factor out inheriting FDs code · 455f9b56
    Pavel Emelyanov authored
    We have two places where we lookup the inherited-fd list
    by name and dup() the descriptor found. I propose to factor
    out this piece in a single inherited_fd() call. When
    we will want to support inheritance for sockets or any
    other files we'll simply add the inherited_fd() call
    there.
    
    I'm also thinking about moving the call to inherited_fd
    into generic level, but the open_path() routine doesn't
    allow to do it in a simple manner.
    
    Also we have not yet finished issue with files-vs-inodes
    mapping. Keeping all the logic in one function should
    make the solution simpler.
    Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
    455f9b56
files-reg.c 27.6 KB