Changeset a2a9751 in rtems


Ignore:
Timestamp:
Jun 26, 2016, 4:43:25 PM (3 years ago)
Author:
Patrick Gauvin <gauvin@…>
Branches:
4.11
Children:
a346408e
Parents:
1a304307
git-author:
Patrick Gauvin <gauvin@…> (06/26/16 16:43:25)
git-committer:
Chris Johns <chrisj@…> (02/08/18 03:21:13)
Message:

libdl: Clear error between dlerror invocations

Updates #2747

Location:
cpukit/libdl
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • cpukit/libdl/dlfcn.c

    r1a304307 ra2a9751  
    1919#include <dlfcn.h>
    2020#include <rtems/rtl/rtl.h>
     21#include "rtl-error.h"
    2122
    2223static rtems_rtl_obj_t*
     
    131132  static char msg[64];
    132133  rtems_rtl_get_error (msg, sizeof (msg));
     134  rtems_rtl_clear_error ();
    133135  return msg;
    134136}
  • cpukit/libdl/rtl-error.c

    r1a304307 ra2a9751  
    5353  return EIO;
    5454}
     55
     56void
     57rtems_rtl_clear_error (void)
     58{
     59  rtems_rtl_data_t* rtl = rtems_rtl_lock ();
     60  if (rtl != NULL)
     61  {
     62    rtl->last_errno = 0;
     63    rtl->last_error[0] = '\0';
     64    rtems_rtl_unlock ();
     65  }
     66}
  • cpukit/libdl/rtl-error.h

    r1a304307 ra2a9751  
    3838void rtems_rtl_set_error (int error, const char* format, ...) RTEMS_RTL_PRINTF_ATTR;
    3939
     40/**
     41 * Clears the error.
     42 */
     43void rtems_rtl_clear_error (void);
     44
    4045#ifdef __cplusplus
    4146}
Note: See TracChangeset for help on using the changeset viewer.