Displaying 18 results from an estimated 18 matches for "upslog_with_errno".
2018 Feb 04
0
[PATCH 2/3] Add generic facility to override HID report descriptor in usbhid-ups
...en);
upsdebug_hex(3, "Report Descriptor", rdbuf, rdlen);
+ /* Check whether we have an override descriptor */
+ descfile = getval("hid_descriptor");
+ if (descfile) {
+ unsigned char *buf;
+ size_t size;
+ FILE *f;
+
+ f = fopen(descfile, "r");
+ if (!f) {
+ upslog_with_errno(LOG_ERR, "Can't open %s", descfile);
+ return 0;
+ }
+
+ fseek(f, 0, SEEK_END);
+ size = ftell(f);
+
+ fseek(f, 0, SEEK_SET);
+
+ buf = xmalloc(size);
+
+ if (fread(buf, size, 1, f) != 1) {
+ upslog_with_errno(LOG_CRIT, "Short read of %s", descfile);
+ fclose(f);...
2011 Mar 05
19
[RFC apcsmart V3 00/18] apcsmart driver updates
Sorry for a bit longer delay than I anticipated, I was stuffed with the work.
This is the next iteration of the patch adding some functionality to apcsmart
driver, and relying on 'ignorelb' recently added.
Follow up from previous thread:
http://www.mail-archive.com/nut-upsdev at lists.alioth.debian.org/msg02331.html
Main differences is that V3 is split into many small patches, so the
2016 Apr 26
0
[PATCH] upsmon: Add NOTIFYMSG to env of NOTIFYCMD
...1,7 @@
setenv("UPSNAME", "", 1);
setenv("NOTIFYTYPE", ntype, 1);
+ setenv("NOTIFYMSG", notice, 1);
if (system(exec) == -1) {
upslog_with_errno(LOG_ERR, "%s", __func__);
}
2008 Aug 06
1
possible regression in genericups with Tripplite UPS
reported through launchpad: https://bugs.launchpad.net/bugs/253999
the possible regression is between nut 2.0.1 (sarge) and 2.2.1
(confirmed Jamie?)
@Arjen: it may be related to some of your changes there...
@Jamie: we'll need some debug output from the drivers (-DDD)
Arnaud
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
+++
2011 Jun 28
0
[nut-commits] svn commit r3081 - branches/apcsmart-dev/drivers
...lif defined(HAVE_FLOCK)
> + #elif defined(HAVE_FLOCK)
> ret = flock(fd, LOCK_EX | LOCK_NB);
> -#elif defined(HAVE_LOCKF)
> + #elif defined(HAVE_LOCKF)
> lseek(fd, 0L, SEEK_SET);
> ret = lockf(fd, F_TLOCK, 0L);
> -#endif
> + #endif
> if (ret < 0)
> upslog_with_errno(LOG_ERR, "apc_ser_try: couldn't lock the port
> (%s)", device_path);
> }
Trivial - preprocessor directives are *not* C-code and should start in
column 1 (and not inlined with the code) for clarity. So it was
actually correct before this commit... :-)
Best regards, Arje...
2006 Jul 06
3
patch file
Skipped content of type multipart/alternative-------------- next part --------------
A non-text attachment was scrubbed...
Name: nut-patch.zip
Type: application/zip
Size: 18721 bytes
Desc: not available
Url : http://lists.alioth.debian.org/pipermail/nut-upsdev/attachments/20060706/c4c32226/nut-patch.zip
2011 Feb 07
4
[PATCH/RFC v2 0/3] Updates to ACP smart driver
This is 2nd version of the earlier patch featuring a few new features
and fixes to the apcsmart driver, following the remarks in:
http://www.mail-archive.com/nut-upsdev at lists.alioth.debian.org/msg02294.html
Major changes from v1:
- handle battery.charge and battery.runtime checks at main.c level
- handle "immutable but writable" conflict gracefully at driver level
-
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 May 13
0
No subject
...ot;);
dstate_setinfo("ups.model","Unknown");
}
void upsdrv_updateinfo(void)
{
unsigned char reply[REPLY_PACKETSIZE];
int ret, online, battery_normal;
unsigned char test;
ret = query_ups(reply);
if (ret < 0) {
upslog_with_errno(LOG_INFO, "Query to UPS failed");
dstate_datastale();
return;
}
/*
* 3rd bit of 4th byte indicates whether the UPS is on line (1)
* or on battery (0)
*/
online = (reply[3]&4)>>2;
/*...
2007 May 13
0
No subject
...weex");
dstate_setinfo("ups.model","Unknown");
}
void upsdrv_updateinfo(void)
{
unsigned char reply[REPLY_PACKETSIZE];
int ret, online, battery_normal;
unsigned char test;
ret = query_ups(reply);
if (ret < 0) {
upslog_with_errno(LOG_INFO, "Query to UPS failed");
dstate_datastale();
return;
}
/*
* 3rd bit of 4th byte indicates whether the UPS is on line (1)
* or on battery (0)
*/
online = (reply[3]&4)>>2;
/*
* 2nd...
2007 May 13
0
No subject
...weex");
dstate_setinfo("ups.model","Unknown");
}
void upsdrv_updateinfo(void)
{
unsigned char reply[REPLY_PACKETSIZE];
int ret, online, battery_normal;
unsigned char test;
ret = query_ups(reply);
if (ret < 0) {
upslog_with_errno(LOG_INFO, "Query to UPS failed");
dstate_datastale();
return;
}
/*
* 3rd bit of 4th byte indicates whether the UPS is on line (1)
* or on battery (0)
*/
online = (reply[3]&4)>>2;
/*
* 2nd...
2011 Jan 25
1
[RFC] Updates to ACP smart driver
This patch introduces a handful of new options, I mentioned earlier in:
http://www.mail-archive.com/nut-upsdev at lists.alioth.debian.org/msg02088.html
See the large commit message in the follow-up for the details and rationale.
I realize it's a bit larger diff - so if it's required I can split it into few
smaller ones.
Michal Soltys (1):
APC smart driver update and new features.
2007 Nov 20
2
Mustek Powermust 600VA
Hi,
I'm having a hard time configuring a Mustek Powermust 600VA ups to
work via USB with nut. I read somewhere that nut works OK via the
rs232 cable, but unfortunately I don't have a COM port in my computer.
The kernel detects the ups as an Xbox pad :) and loads the xpad
module. I tried running /lib/nut/megatec with different /dev/ttySx but
it displays megatec protocol UPS was not
2016 Apr 17
2
NUT Windows port sources review
...environment, I had some problems to understand what is going on and what is wrong: it is quite hard to increase logging level and it is uncomfortable to work with Windows Event Log. I think that logging architecture should be improved.
Linux version contains several logging function like upslogx, upslog_with_errno, upsdebugx, etc. All of them call vupslog function inside. This function can write messages into STDERR stream and send them into syslog (writing to a log file is not required because Linux has syslogd, logrotation, etc.).
Windows port contains the same function. It can write messages into STDERR...
2007 May 25
0
Patch -- SVN revision in the version string
...Index: include/common.h
===================================================================
--- include/common.h (revision 916)
+++ include/common.h (working copy)
@@ -86,6 +86,7 @@
/* Return the alternate path for pid files */
const char * altpidpath(void);
+const char *upsversion(void);
void upslog_with_errno(int priority, const char *fmt, ...)
__attribute__ ((__format__ (__printf__, 2, 3)));
void upslogx(int priority, const char *fmt, ...)
Index: server/netget.c
===================================================================
--- server/netget.c (revision 916)
+++ server/netget.c (working copy)
@...
2016 Apr 25
0
NUT Windows port sources review
...rying to solve, but
the NUT logging code could use some cleanup, and I wouldn't want
someone to have to do this twice. I personally like the idea of more
descriptive log levels, but have not had a chance to map this out
myself.
> Linux version contains several logging function like upslogx, upslog_with_errno, upsdebugx, etc. All of them call vupslog function inside. This function can write messages into STDERR stream and send them into syslog (writing to a log file is not required because Linux has syslogd, logrotation, etc.).
>
> Windows port contains the same function. It can write messages int...
2011 Oct 03
2
patch: Replace many usleep and some sleep calls with nanosleep
...b/clients/upssched.c 2011-08-17 00:40:17.000000000 +0300
@@ -652,7 +652,7 @@ static int check_parent(const char *cmd,
unlink(lockfn);
/* give the other one a chance to start it, then try again */
- usleep(250000);
+ struct timespec delay = {0, 250e6}; nanosleep(&delay, NULL);
}
upslog_with_errno(LOG_ERR, "Failed to connect to parent and failed to create parent");
@@ -705,7 +705,7 @@ static void sendcmd(const char *cmd, con
if (pipefd == PARENT_STARTED) {
/* loop back and try to connect now */
- usleep(250000);
+ struct timespec delay = {0, 250e6}; nanosleep(&dela...