On Fri, 2005-05-20 at 12:26 +0200, Maarten Lankhorst wrote:
What do you suggest then ... fprintf(stderr?
Absolutely not. :) But there are other options available: TRACE/WARN/FIXME. There's also MESSAGE, but it should be used *very* little. Also remember that most people will not see MESSAGE()s anyway because they only go to console.
- if (stat (device, &st) == -1) {
ERR("%s: %s\n", device, strerror(errno));
CoTaskMemFree(capBox);
return E_FAIL;
- }
Why is this a ERR()?
This is more like a WARN or MESSAGE.
- if (!S_ISCHR (st.st_mode)) {
ERR("%s: Not a device\n", device);
CoTaskMemFree(capBox);
return E_FAIL;
- }
Same here.
- capBox->fd = open(device, O_RDWR | O_NONBLOCK);
- if (capBox->fd == -1) {
ERR("%s: Failed to open: %s\n", device, strerror(errno));
CoTaskMemFree(capBox);
return E_FAIL;
- }
Ditto.