Changeset 138557 for trunk/base


Ignore:
Timestamp:
Jul 12, 2015, 10:56:10 AM (5 years ago)
Author:
cal@…
Message:

base: darwintrace: refactor FD closing in exec-style functions

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/base/src/darwintracelib1.0/proc.c

    r126475 r138557  
    222222        bytes_read = read(fd, buffer, sizeof(buffer) - 1);
    223223        buffer[bytes_read] = '\0';
     224        close(fd);
     225
    224226        const char *buffer_end = buffer + bytes_read;
    225227        if (bytes_read > 2 && buffer[0] == '#' && buffer[1] == '!') {
     
    239241                /* check the iterpreter against the sandbox */
    240242                if (!__darwintrace_is_in_sandbox(interp, DT_REPORT | DT_ALLOWDIR | DT_FOLLOWSYMS)) {
    241                         close(fd);
    242243                        return ENOENT;
    243244                }
    244245        }
    245246
    246         close(fd);
    247247        return 0;
    248248#undef open
Note: See TracChangeset for help on using the changeset viewer.