Changeset e23afc3 in rtems


Ignore:
Timestamp:
Nov 28, 2000, 9:49:27 PM (20 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, 5, master
Children:
6b5519a
Parents:
66fedb46
Message:

2000-11-28 Sergei Organov <osv@…>

  • libc/getcwd.c: Ensure _closedir(dir) is called even on error exit from the routine.
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • c/src/exec/libcsupport/src/getcwd.c

    r66fedb46 re23afc3  
    7575{
    7676  register struct dirent *dp;
    77   register DIR *dir;
     77  register DIR *dir = 0;
    7878  register dev_t dev;
    7979  register ino_t ino;
     
    255255      bcopy (dp->d_name, bpt, strlen (dp->d_name));
    256256      (void) _closedir (dir);
     257      dir = 0;
    257258
    258259      /* Truncate any file name. */
     
    272273
    273274err:
     275  if(dir)
     276    (void) _closedir (dir);
    274277  if (ptsize)
    275278    free (pt);
  • c/src/lib/ChangeLog

    r66fedb46 re23afc3  
     1
     22000-11-28       Sergei Organov <osv@javad.ru>
     3
     4        * libc/getcwd.c: Ensure _closedir(dir) is called even on
     5        error exit from the routine.
    16
    272000-11-25  Antti P Miettinen  <antti.p.miettinen@nokia.com>
  • c/src/lib/libc/getcwd.c

    r66fedb46 re23afc3  
    7575{
    7676  register struct dirent *dp;
    77   register DIR *dir;
     77  register DIR *dir = 0;
    7878  register dev_t dev;
    7979  register ino_t ino;
     
    255255      bcopy (dp->d_name, bpt, strlen (dp->d_name));
    256256      (void) _closedir (dir);
     257      dir = 0;
    257258
    258259      /* Truncate any file name. */
     
    272273
    273274err:
     275  if(dir)
     276    (void) _closedir (dir);
    274277  if (ptsize)
    275278    free (pt);
  • cpukit/libcsupport/src/getcwd.c

    r66fedb46 re23afc3  
    7575{
    7676  register struct dirent *dp;
    77   register DIR *dir;
     77  register DIR *dir = 0;
    7878  register dev_t dev;
    7979  register ino_t ino;
     
    255255      bcopy (dp->d_name, bpt, strlen (dp->d_name));
    256256      (void) _closedir (dir);
     257      dir = 0;
    257258
    258259      /* Truncate any file name. */
     
    272273
    273274err:
     275  if(dir)
     276    (void) _closedir (dir);
    274277  if (ptsize)
    275278    free (pt);
Note: See TracChangeset for help on using the changeset viewer.