Changeset bad8d41 in mainline for uspace/lib/c


Ignore:
Timestamp:
2017-12-21T20:24:54Z (8 years ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Parents:
f04b5b3
git-author:
Jiří Zárevúcky <zarevucky.jiri@…> (2017-12-21 18:24:59)
git-committer:
Jiří Zárevúcky <zarevucky.jiri@…> (2017-12-21 20:24:54)
Message:

The "not-so-obvious" error handling tweaks.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/include/io/klog.h

    rf04b5b3 rbad8d41  
    4949#define KLOG_PRINTF(lvl, fmt, ...) ({ \
    5050        char *_s; \
    51         int _c = asprintf(&_s, fmt, ##__VA_ARGS__); \
    52         if (_c >= 0) { \
    53                 _c = klog_write((lvl), _s, str_size(_s)); \
     51        int _rc = ENOMEM; \
     52        if (asprintf(&_s, fmt, ##__VA_ARGS__) >= 0) { \
     53                _rc = klog_write((lvl), _s, str_size(_s)); \
    5454                free(_s); \
    5555        }; \
    56         (_c >= 0); \
     56        (_rc != EOK); \
    5757})
    5858
Note: See TracChangeset for help on using the changeset viewer.