search for: upsdebug_with_errno

Displaying 8 results from an estimated 8 matches for "upsdebug_with_errno".

2007 Jan 23
2
Re: [nut-commits] svn commit r731
...s; ai != NULL; ai = ai->ai_next) { > + int sock_fd; > + > + if ((ai->ai_socktype != hints.ai_socktype) || (ai->ai_protocol != hints.ai_protocol)) > + continue; > + > + if ((sock_fd = socket(ai->ai_family, ai->ai_socktype, ai->ai_protocol)) < 0) { > + upsdebug_with_errno(3, "setuptcp: socket"); > + continue; > + } > + > + > + if (setsockopt(sock_fd, SOL_SOCKET, SO_REUSEADDR, (void *)&one, sizeof(one)) != 0) > + fatal_with_errno("setuptcp: setsockopt"); > + > + if (bind(sock_fd, ai->ai_addr, ai->ai_addrl...
2016 Jul 11
0
Proposal for technique to stop a timer at any moment
...o syslog early */ diff -rup nut-2.7.4.orig/common/common.c nut-2.7.4.dev/common/common.c --- nut-2.7.4.orig/common/common.c 2015-12-29 13:08:34.000000000 +0100 +++ nut-2.7.4.dev/common/common.c 2016-07-01 09:51:14.779883781 +0200 @@ -407,10 +407,25 @@ void upslogx(int priority, const char *f void upsdebug_with_errno(int level, const char *fmt, ...) { va_list va; - - if (nut_debug_level < level) - return; + /* Sysadmin may use "echo n > /etc/ups/NUT_DEBUG_LEVEL" to set debug level n. RP */ + char fn[SMALLBUF]; + FILE *fp; + int ndl; /* 0 through 4 */ + + snprintf(fn, sizeof(fn), &...
2018 Feb 04
0
[PATCH 2/3] Add generic facility to override HID report descriptor in usbhid-ups
..."Short read of %s", descfile); + fclose(f); + free(buf); + return 0; + } + fclose(f); + + rdbuf = buf; + rdlen = size; + } + /* Parse Report Descriptor */ Free_ReportDesc(pDesc); pDesc = Parse_ReportDesc(rdbuf, rdlen); + + if (descfile) + free(rdbuf); + if (!pDesc) { upsdebug_with_errno(1, "Failed to parse report descriptor!"); return 0; -- 2.7.4 -- Russell King
2009 Jul 10
1
PowerWare USB debug messages
Earlier this year, I added a patch to my local NUT tree to additionally print the value of usb_strerror() if usb_clear_halt() failed. (Ignore the commented-out goto.) Since these messages are at the LOG_ERR level, should we add usb_strerror() to all of the calls in nut_usb.c? diff --git a/drivers/nut_usb.c b/drivers/nut_usb.c index 494a1fa..4ca2691 100644 --- a/drivers/nut_usb.c +++
2010 Jan 13
1
patch for support Liebert GXT2 ESP2 protocol
Hi All, Attached is a patch against nut-2.4.1 that adds a driver for the ESP2 protocol, as used by the serial port found on the Liebert GXT2. This driver is mostly based on: http://www.csc.liv.ac.uk/~greg/projects/liebertserial with additional bit field information from Spiros Ioannou. liebert.c at the above url has been tested by a few people to return the correct status data. Besides me,
2008 Nov 30
4
Sweex 1000VA UPS (Lakeview Research)
Hi all, i've read a thread about this UPS from Peter van Valderen. He tried to develop a driver for this specific type of UPS. I've downloaded nut-2.2.2 and tried to apply the patches (lakeview.patch & lakeview.v2.patch) but both resulted in rejected chunks. I've tried to ./configure with type lakeview and then a make, but the make command fails. Does anybody has any
2018 Feb 04
5
[PATCH 0/3] OpenUPS updates
Hi, I've been checking out NUT with an OpenUPS board over the last couple of weekends, and have noticed that it doesn't seem to report sensible values. This lead me to investigate usbhid-ups and delve into various issues. As mentioned in a github issue, one of the problems is with the report descriptor - dumping this from the usbhid-ups debug output and picking through it reveals that
2007 Aug 23
1
[nut-commits] svn commit r1073 - in trunk: . drivers
...quot;); > > /* create a new matcher for later reopening */ > - reopen_matcher = new_exact_matcher(hd); > - if (!reopen_matcher) { > - upsdebugx(2, "new_exact_matcher: %s", strerror(errno)); > + r = HIDNewExactMatcher(&reopen_matcher, hd); > + if (r) { > + upsdebug_with_errno(2, "HIDNewExactMatcher"); > } > /* link the two matchers */ > reopen_matcher->next = regex_matcher; > @@ -1403,8 +1404,7 @@ > > void upsdrv_cleanup(void) > { > - if (hd != NULL) { > - HIDCloseDevice(udev); > - udev = NULL;...