diff options
author | Suren A. Chilingaryan <csa@dside.dyndns.org> | 2011-03-25 12:11:05 +0100 |
---|---|---|
committer | Suren A. Chilingaryan <csa@dside.dyndns.org> | 2011-03-25 12:11:05 +0100 |
commit | a5fc8db4f29a38089c5f81433b90702ef7db60d1 (patch) | |
tree | 33dc7752f4426c77afe5f018caeb2212f17d2fe6 /pci.c | |
parent | d1a6c3d98b3f62166b044ff1490589c11846bf6e (diff) | |
download | ipecamera-a5fc8db4f29a38089c5f81433b90702ef7db60d1.tar.gz ipecamera-a5fc8db4f29a38089c5f81433b90702ef7db60d1.tar.bz2 ipecamera-a5fc8db4f29a38089c5f81433b90702ef7db60d1.tar.xz ipecamera-a5fc8db4f29a38089c5f81433b90702ef7db60d1.zip |
Fix exiting on warnings
Diffstat (limited to 'pci.c')
-rw-r--r-- | pci.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -53,8 +53,10 @@ void (*pcilib_error)(const char *msg, ...) = pcilib_print_error; void (*pcilib_warning)(const char *msg, ...) = pcilib_print_error; int pcilib_set_error_handler(void (*err)(const char *msg, ...), void (*warn)(const char *msg, ...)) { - pcilib_error = err; - pcilib_warning = warn; + if (err) pcilib_error = err; + else pcilib_error = pcilib_print_error; + if (warn) pcilib_warning = warn; + else pcilib_warning = pcilib_print_error; } pcilib_t *pcilib_open(const char *device, pcilib_model_t model) { |