diff options
author | Hans Ulrich Niedermann <gp@n-dimensional.de> | 2005-02-12 22:37:55 +0000 |
---|---|---|
committer | Hans Ulrich Niedermann <gp@n-dimensional.de> | 2005-02-12 22:37:55 +0000 |
commit | 902e5861446ec8a828ee510a01b9e2715c952b3e (patch) | |
tree | cba30b9f03d80d97d9902e83d3f7ef651083cc41 /packaging/linux-hotplug | |
parent | 889b1a1c469c2a18654dfa9da8522e28bd44c912 (diff) | |
download | libgphoto2-902e5861446ec8a828ee510a01b9e2715c952b3e.tar.gz |
print-usb-usermap: print error message in case of failure
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@7596 67ed7778-7388-44ab-90cf-0a291f65f57c
Diffstat (limited to 'packaging/linux-hotplug')
-rw-r--r-- | packaging/linux-hotplug/print-usb-usermap.c | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/packaging/linux-hotplug/print-usb-usermap.c b/packaging/linux-hotplug/print-usb-usermap.c index 246807681..5bf4a96c9 100644 --- a/packaging/linux-hotplug/print-usb-usermap.c +++ b/packaging/linux-hotplug/print-usb-usermap.c @@ -60,7 +60,28 @@ #define GP_USB_HOTPLUG_MATCH_DEV_SUBCLASS 0x0100 #define GP_USB_HOTPLUG_MATCH_DEV_PROTOCOL 0x0200 -#define CR(result) {int r = (result); if (r < 0) return (r);} +#ifdef __GNUC__ +#define CR(result) \ + do { \ + int r = (result); \ + if (r < 0) { \ + fprintf(stderr, "print-usb-usermap: " \ + "Fatal error running `%s'.\n" \ + "Aborting.\n", #result ); \ + return (r); \ + } \ + } while (0) +#else /* !__GNUC__ */ +#define CR(result) \ + do { \ + int r = (result); \ + if (r < 0) { \ + fprintf(stderr, "print-usb-usermap: " \ + "Fatal error detected, aborting.\n"); \ + return (r); \ + } \ + } while (0) +#endif /* __GNUC__ */ /* print-usb-usermap * |