lkml.org 
[lkml]   [2008]   [Sep]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [RFC v4][PATCH 9/9] File descriprtors (restore)


    Dave Hansen wrote:
    > On Tue, 2008-09-09 at 03:42 -0400, Oren Laadan wrote:
    >> +static int cr_close_all_fds(struct files_struct *files)
    >> +{
    >> + int *fdtable;
    >> + int n;
    >> +
    >> + do {
    >> + n = cr_scan_fds(files, &fdtable);
    >> + if (n < 0)
    >> + return n;
    >> + while (n--)
    >> + sys_close(fdtable[n]);
    >> + kfree(fdtable);
    >> + } while (n != -1);
    >> +
    >> + return 0;
    >> +}
    >
    > This needs to use an ERR_PTR(). It will save using the double-pointer.

    I suppose you refer to the call to cr_scan_fds(): either 'fdtable'
    or 'n' will have to pass-by-reference. Is it that you prefer it to be
    fdtable = cr_scan_fds(files, &n);
    ?

    Oren.



    \
     
     \ /
      Last update: 2008-09-10 03:57    [W:0.024 / U:0.332 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site