Print this page
Thread safety fixes.

Split Close
Expand all
Collapse all
          --- old/usr/src/lib/libc/port/locale/timelocal.c
          +++ new/usr/src/lib/libc/port/locale/timelocal.c
↓ open down ↓ 77 lines elided ↑ open up ↑
  78   78          "%a %b %e %H:%M:%S %Z %Y",
  79   79  
  80   80          /*
  81   81           * ampm_fmt - To determine 12-hour clock format time (empty, if N/A)
  82   82           */
  83   83          "%I:%M:%S %p"
  84   84  };
  85   85  
  86   86  struct locdata __posix_time_locdata = {
  87   87          .l_lname = "C",
  88      -        .l_refcnt = (uint32_t)-1,
  89   88          .l_data = { &lc_time_posix }
  90   89  };
  91   90  
  92   91  struct locdata *
  93   92  __lc_time_load(const char *name)
  94   93  {
  95   94          struct locdata  *ldata;
  96   95          struct lc_time  *ltime;
  97   96          int ret;
  98   97  
  99   98          if ((ldata = __locdata_alloc(name, sizeof (*ltime))) == NULL) {
 100   99                  errno = EINVAL;
 101  100                  return (NULL);
 102  101          }
 103  102          ltime = ldata->l_data[0];
 104  103  
 105  104          ret = __part_load_locale(name, (char **)&ldata->l_data[1],
 106  105              "LC_TIME", LCTIME_SIZE, LCTIME_SIZE, (const char **)ltime);
 107  106  
 108  107          if (ret != _LDP_LOADED) {
 109      -                __locdata_release(ldata);
      108 +                __locdata_free(ldata);
 110  109                  errno = EINVAL;
 111  110                  return (NULL);
 112  111          }
 113  112  
 114  113          return (ldata);
 115  114  }
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX