search for: getval

Displaying 20 results from an estimated 30 matches for "getval".

Did you mean: retval
2006 Sep 22
1
Stack corruption in newhidups.c
...UPS SYSTEMS units * So we don't need the regex mechanism */ int r; char *regex_array[5]; ^^^^^^^^^^^^^^^ => should be 6 /* enforce use of the "vendorid" option if "generic" is given */ if (testvar("generic") && getval("vendorid")==NULL) { fatalx("must specify \"vendorid\" when using \"generic\""); } /* process the UPS selection options */ regex_array[0] = getval("vendorid"); regex_array[1] = getval("productid"); re...
2020 Apr 03
0
Patch to support Powercool PCRACK-1200VA
...language ID workaround to the krauler subdriver (0x409 or 0x4095)"); + +    addvar(VAR_VALUE, "buflen_fix", "Apply the buflen workaround to the krauler subdriver"); +  #endif    /* QX_USB */  #ifdef QX_SERIAL @@ -1822,7 +1834,8 @@ void    upsdrv_initups(void)          getval("product") ||          getval("serial") ||          getval("bus") || -        getval("langid_fix") +        getval("langid_fix") || +        getval("buflen_fix")      ) {          /* USB */          is_usb = 1; @@ -1941,6 +1954,22 @@...
2020 Apr 03
0
Powercool PCRACK-1200VA patch update
...0. However, some newer       * Eaton units have a light HID descriptor at index 0, and the full @@ -173,6 +249,32 @@ static int libusb_open(usb_dev_handle **udevp, USBDevice_t *curDevice, USBDevice      libusb_close(*udevp);  #endif +    /* check for buflen workaround */ +    int blen; +    if(getval("buflen_fix")) { +        if(sscanf(getval("buflen_fix"),"%d",&blen) != 1) { +            upslogx(LOG_NOTICE, "Error enabling buflen workaround"); +        } else { +            if (blen > USB_BUFLEN_MAX) { +                upslogx(LOG_NOTICE, +       ...
2007 Oct 19
4
[PATCH] nr_cpus calculation problem due to incorrect sockets_per_node
Testing on an 8-node 128-way NUMA machine has exposed a problem with Xen''s nr_cpus calculation. In this case, since Xen cuts off recognized CPUs at 32, the machine appears to have 16 CPUs on the first and second nodes and none on the remaining nodes. Given this asymmetry, the calculation of sockets_per_node (which is later used to calculate nr_cpus) is incorrect:
2017 Feb 04
2
Wrong relocation emitted when building shared libraries with Control Flow Integrity
...ow at runtime; recompile with -fPIC Recompiling with -fPIC does not actually help. I've managed to create a minimal reproducible testcase. Full command line and code to reproduce are below. --- hello.c --- #include <stdio.h> #include <stdlib.h> typedef void(*freeptr)(void*); int getval(freeptr fp) { void *m = malloc(sizeof(int)); if(m) { fp(m); } return 42; } int export() { printf("Test: %d\n", getval(free)); return 0; } --- --- command line --- clang-3.9 -shared -fuse-ld=gold -flto -fsanitize=cfi-icall -fPIC -o libhello.so hello.c ---...
2012 Jul 06
1
[LLVMdev] Elf_Dyn_Impl Question
Should Elf_Dyn_Impl in Object/ELF.h also have a 32bit version. getTag/getVal/getPtr all return 64bit types however Elf_Addr etc will not always be 32bit?
2008 Mar 26
2
passing parameters to the newly booted kernel
is it possible to pass parameters from a .cfg file to the newly booted kernel? my setup is pxelinux where the relevent config is label fbsd63 kernel memdisk append initrd=/freebsd6.3.hd harddisk what i would like to do is pass in some parameter so the booted kernel can behave differently. i've looked in teh archives without success, although i did see an elliptic reference to
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.
2010 Mar 16
1
NUT megatec driver tunning
...le) for UPS execute command. My UPS stupid > after 'C' and not accept immediately next command on 'upsdrv_initinfo' > procedure. > I strongly recommend to add its. > ________________________________________________ > > I think line: > > send_pace = CLAMP(atoi(getval("sendpace")), 1, 1000) * 1000; > need replaced by > send_pace = CLAMP(atoi(getval("sendpace")), 0, 1000) * 1000; > > Why limiting minimal value to 1 millisecond ? I recommend to allow set > 'send_pace' to ZERO if set ' sendpace=0' in config file ...
2012 Nov 20
2
[PATCH][RFC] OpenUPS driver
...5,7 @@ ATTRS{idVendor}=="03f0", ENV{UPOWER_VENDOR}="Hewlett Packard" ATTRS{idVendor}=="0463", ENV{UPOWER_VENDOR}="Eaton" ATTRS{idVendor}=="047c", ENV{UPOWER_VENDOR}="Dell" +ATTRS{idVendor}=="04d8", ENV{UPOWER_VENDOR}="for getval()" ATTRS{idVendor}=="050d", ENV{UPOWER_VENDOR}="Belkin" ATTRS{idVendor}=="051d", ENV{UPOWER_VENDOR}="APC" ATTRS{idVendor}=="0592", ENV{UPOWER_VENDOR}="Powerware" @@ -47,6 +48,9 @@ # Dell ATTRS{idVendor}=="047c", ATTRS{i...
2007 Aug 23
1
[nut-commits] svn commit r1073 - in trunk: . drivers
...u Aug 23 19:43:41 2007 > @@ -153,6 +153,7 @@ > HIDDeviceMatcher_t subdriver_matcher; > int ret, i; > char flush_buf[256]; > + int mode = MODE_NOHID; > > HIDDeviceMatcher_t *regex_matcher = NULL; > int r; > @@ -200,21 +201,21 @@ > regex_array[4] = NULL; /* getval("serial"); */ > regex_array[5] = getval("bus"); > > - r = new_regex_matcher(&regex_matcher, regex_array, REG_ICASE | REG_EXTENDED); > + r = HIDNewRegexMatcher(&regex_matcher, regex_array, REG_ICASE | REG_EXTENDED); > if (r==-1) { > - fatalx(EXIT_...
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 -
2009 Feb 04
2
[nut-commits] svn commit r1765 - in trunk: . drivers man
...39;t be listening anymore. > 958 addvar(VAR_VALUE, "ups.delay.shutdown", "Override > shutdown delay (120s)"); > 959 addvar(VAR_VALUE, "ups.delay.start", "Override restart > delay (10s)"); This doesn't work without using getval() somewhere in the driver. > 971 ioctl(upsfd, TIOCMBIC, &rts_bit); > 972 ioctl(upsfd, TIOCMBIC, &dtr_bit); We have library functions in serial.c to handle this. Use them. Best regards, Arjen -- Please keep list traffic on the list
2006 Dec 30
3
Newpoint 200897 UPS
...on, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ #include "newhidups.h" #include "powercom-hid.h" #include "extstate.h" /* for ST_FLAG_STRING */ #include "dstate.h" /* for STAT_INSTCMD_HANDLED */ #include "main.h" /* for getval() */ #include "common.h" #define POWERCOM_HID_VERSION "Powercom HID 0.1" #define POWERCOM_VENDORID 0x0d9f /* --------------------------------------------------------------- */ /* Vendor-specific usage table */ /* -----------------------------------------------------...
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
2018 Feb 04
0
[PATCH 2/3] Add generic facility to override HID report descriptor in usbhid-ups
...const char *mfr = NULL, *model = NULL, *serial = NULL, *descfile; #ifndef SHUT_MODE int ret; #endif upsdebugx(2, "Report Descriptor size = %d", rdlen); 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); + + fs...
2006 Jun 09
0
Cleaned up belkinunv diff
...g to post on here. I've made a couple of tweaks too... nothing major though; - the first change comes out of me having a bit more of a clue as to how things are working in the code, and makes the detection of [ waitonshutdown == "true" ] a little more complete (I'd missed out getval when checking if waitonshutdown were present and dstate_getinfo when checking if it were true... I'm *really* not sure why I did... probably excess blood in my caffeine stream at the time! ;-) ) - the second change removed the function I'd introduced to perform the original "shut...
2006 Apr 26
1
RE nut 2.0 fentonups and Xanto S3000R
...char *get_id(void) void upsdrv_initinfo(void) { int modelnum, i, ret; - char temp[256], model[32], *raw; + char temp[256], qmodel[32], *model, *raw = NULL; - raw = get_id(); + model = getval("model"); - if (!raw) - fatalx("Unable to detect a Fenton or Megatec protocol UPS"); + if (!model) { + raw = get_id(); - snprintf(temp, sizeof(temp), "%s", r...
2006 May 12
1
Fwd: RE New xanto driver for NUT
Dear Andreas, some googling revealed, you created a driver for the xanto series of online-usv.de. In what state it is currently? I've to manage a S2000 and would like to use nut for it, is it usable by now? Do you need another tester? TIA, Pete
2009 Aug 14
2
Bestfortress driver, network serial patch for nut-2.0
....01 (%s)\n\n", UPS_VERSION); } struct { char * val; speed_t speed; } speed_table[] = { {"1200", B1200}, {"2400", B2400}, {"4800", B4800}, {"9600", B9600}, {NULL, B1200}, }; void upsdrv_initups(void) { speed_t speed = B1200; char * speed_val = getval("baudrate"); char * max_load = getval("max_load"); if (max_load) maxload = atoi(max_load); if (speed_val) { int i; for (i=0; speed_table[i].val; i++) { if (strcmp (speed_val, speed_table[i].val) == 0) break; } speed = speed_table[i].speed; } upsfd = ser_o...