Changeset c14d5c40b68a3d2304fb518a6f4970e78dc76a16

Show
Ignore:
Timestamp:
09/28/10 18:27:03 (4 years ago)
Author:
Theo Schlossnagle <jesus@omniti.com>
git-committer:
Theo Schlossnagle <jesus@omniti.com> 1285698423 +0000
git-parent:

[bc4160b81be05c09b370583e4ded0dc40c0e0f02]

git-author:
Theo Schlossnagle <jesus@omniti.com> 1285698423 +0000
Message:

this appears to work fine, checked on multiple types, refs #318

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • src/modules/lua.c

    re36e691 rc14d5c4  
    303303  if(lua_isnil(L, 2)) { 
    304304    noit_stats_set_metric(&ci->current, metric_name, metric_type, NULL); 
    305     return 0; 
     305    lua_pushboolean(L, 1); 
     306    return 1; 
     307  } 
     308  switch(metric_type) { 
     309    case METRIC_INT32: 
     310    case METRIC_UINT32: 
     311    case METRIC_INT64: 
     312    case METRIC_UINT64: 
     313    case METRIC_DOUBLE: 
     314      if(!lua_isnumber(L, 2)) { 
     315        noit_stats_set_metric(&ci->current, metric_name, metric_type, NULL); 
     316        lua_pushboolean(L, 0); 
     317        return 1; 
     318      } 
     319    default: 
     320    break; 
    306321  } 
    307322  switch(metric_type) { 
     
    332347      break; 
    333348  } 
    334   return 0; 
     349  lua_pushboolean(L, 1); 
     350  return 1; 
    335351} 
    336352static int