Ignore:
Timestamp:
06/28/18 11:26:07 (3 years ago)
Author:
Shane Alcock <salcock@…>
Branches:
cachetimestamps, develop, master, rc-4.0.4, ringdecrementfix, ringperformance
Children:
055a2c9, b06b894
Parents:
47d4f8c
Message:

Be less casual with error checking in SCB data structure

  • ftruncate can fail, so actually check for that during init.
  • If this does happen, return an error from libtrace_scb_init() -- this means that libtrace_scb_init() now returns an int rather than void.
  • Update other API functions to make sure that they don't die horribly if the error returned by init is ignored.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/data-struct/simple_circular_buffer.h

    rb94478f r1ed69dc  
    1313
    1414
    15 DLLEXPORT void libtrace_scb_init(libtrace_scb_t *buf, uint32_t size,
     15DLLEXPORT int libtrace_scb_init(libtrace_scb_t *buf, uint32_t size,
    1616                uint16_t id);
    1717DLLEXPORT void libtrace_scb_destroy(libtrace_scb_t *buf);
Note: See TracChangeset for help on using the changeset viewer.