Commit Graph

1776 Commits

Author SHA1 Message Date
Uwe Hermann 23d68466f8 usbtmc: Silence some overly verbose log messages.
These trigger quite often with unrelated devices and confuse people.

  scpi_usbtmc: Failed to get configuration descriptor: LIBUSB_ERROR_NOT_FOUND, ignoring device.
2018-04-08 19:49:41 +02:00
Uwe Hermann 66d2cc3a27 rdtech-dps: User ternary operator. 2018-03-29 15:45:52 +02:00
James Churchill 69b0558395 rdtech-dps: New driver for RDTech DPS/DPH series PSUs. 2018-03-29 15:41:30 +02:00
James Churchill 0549416e36 rdtech-dps: Initial driver skeleton. 2018-03-26 15:41:01 +10:00
James Churchill 7b50a9b869 modbus: Return explicit SR_ERR values as required by modbus.c
The Modbus RTU implementation was inappropriately returning lengths
from the serial functions when the calling functions expect only an
sr_error_code value.
2018-03-26 15:41:01 +10:00
James Churchill d4e0701771 modbus: Increase modbus reply timeout to 500ms.
Needed by rdtech-dps driver, 100ms is too short.
2018-03-26 15:41:01 +10:00
Soeren Apel 366ccb8ab7 resource.c: Fix firmware loading bug (#1140) 2018-03-20 16:13:46 +01:00
Uwe Hermann 410883baf6 backend: Emit firmware search paths in a log message. 2018-03-18 18:26:57 +01:00
Soeren Apel addb7340dd Introduce sr_resourcepaths_get()
This provides an interface to fix #1128.
2018-03-18 18:25:36 +01:00
Axel Hinrichs e843992dda korad-kaxxxxp: Korad OEM: RND KA3005P 2018-03-12 16:34:43 +01:00
Gerhard Sittig 823b0e29ae output/csv: fix out-of-bounds array access in process_analog()
Make sure to not exceed the ctx->analog_samples[] array bounds. Don't
use the (huge) channel's index in the device's(!) channel list, instead
use the zero-based and dense index into the array of analog samples in
the accumulation buffer, before writing to the external file.

This fixes the segfault reported in bug #1124.
2018-03-12 15:55:22 +01:00
Gerhard Sittig a551cb0927 output/csv: use longer names for iteration variables
The process_analog() logic is rather complex, dealing with the total
list of channels in the device (which can be of different types), and a
number of submitted samples for a specified list of channels. Replace
the rather short variable names for i, j, c (and num_channels) with
something longer that hopefully increases readability of the complex
loop bodies.

Note that this change merely renames identifiers, and does not change
behaviour.
2018-03-12 15:55:22 +01:00
Gerhard Sittig b078dddb84 output/csv: reduce indentation in process_analog()
Instead of nesting indentation levels upon equality of a value, skip
iterations upon inequality. This reduces indentation, and might improve
readability.

[ Indentation changes, see 'diff -w -b' for the essence. ]
2018-03-12 15:55:22 +01:00
Frank Stettner 94cf02d0c2 hp-3478a: Remove unnecessary curly brackets. 2018-03-06 19:02:33 +01:00
Frank Stettner a575c90e81 hp-3478a: Set correct number of digits 2018-03-06 17:40:13 +01:00
Frank Stettner acc587ff24 hp-3478a: spec_digits must be parsed before range parsing. 2018-03-06 17:40:13 +01:00
Frank Stettner c3f8e1abf0 arachnid-labs-re-load-pro: Replace C++-style comments with C-style comments. 2018-03-06 17:39:37 +01:00
Frank Stettner cd97e39d89 metex14: Fix wrong measurement modes 2018-03-05 20:23:35 +01:00
Frank Stettner fd8dc1db01 metex14: Add power factor measurement mode 2018-03-05 20:23:26 +01:00
Uwe Hermann 0aaaee2dd3 arachnid-labs-re-load-pro: Simplify a code chunk. 2018-03-03 19:25:05 +01:00
Frank Stettner d7e348f481 arachnid-labs-re-load-pro: Add encoding.digits to analog packet 2018-03-03 19:25:05 +01:00
Frank Stettner 2153093941 arachnid-labs-re-load-pro: Index for channel "I" 2018-03-03 19:25:05 +01:00
Frank Stettner b3e715e528 arachnid-labs-re-load-pro: Get a response when in acquision mode. 2018-03-03 19:25:02 +01:00
Frank Stettner 706350360a arachnid-labs-re-load-pro: Make SR_CONF_REGULATION listable 2018-03-03 19:22:59 +01:00
Frank Stettner 3d70d77709 arachnid-labs-re-load-pro: Add SR_CONF_UNDER_VOLTAGE_THRESHOLD. 2018-03-03 19:10:51 +01:00
Frank Stettner 9edda1d25b arachnid-labs-re-load-pro: Setting correct current limit.
Use round() instead of just truncate the value.
2018-03-03 19:10:51 +01:00
Frank Stettner a217289951 arachnid-labs-re-load-pro: Change serial read in acquisition mode.
Use serial_readline in acquisition mode, otherwise data from the
Re:load Pro could get lost.
Use reloadpro_receive_data() for all commands when in acquisition
mode. When not using a single point of receiving data, data could get
lost.
2018-03-03 19:10:51 +01:00
Gerhard Sittig 4389a54204 pipistrello-ols: style nit, replace DIY endianess conversion 2018-03-03 18:58:59 +01:00
Gerhard Sittig 411b2f6822 link-mso19: improve endianess conversion, avoid mem access alignment issue
Prefer sigrok's endianess conversion helper over the inet htons()
routine which is harder to read (is "network order" little or big?).

Writing the conversion results in units of bytes also avoids misaligned
memory access. The header length is odd, each payload item got written
as an uint16_t item to an odd address.
2018-03-03 18:58:59 +01:00
Gerhard Sittig f7711ed56c uni-t-dmm: style nits, copy loop vs memmove 2018-03-03 18:58:59 +01:00
Gerhard Sittig 69229e5c15 saleae-logic-pro: style nits, copy loop vs memcpy 2018-03-03 18:58:59 +01:00
Gerhard Sittig 093b8ff478 pce-322a: style nits, copy loop vs memmove 2018-03-03 18:58:59 +01:00
Gerhard Sittig c372070333 mic-985xx: style nits, var decl vs assignment, copy loop vs memmove 2018-03-03 18:58:59 +01:00
Gerhard Sittig 7a65106e00 kern-scale: style nits, var decl vs assignment, copy loop vs memmove 2018-03-03 18:58:59 +01:00
Gerhard Sittig 0f6ff97bf8 center-3xx: style nits, var decl vs assignment, copy loop vs memmove 2018-03-03 18:58:59 +01:00
Uwe Hermann bdbb9151af siglent-sds: Drop superfluous log message.
This information is already emitted by other layers.
2018-03-03 18:45:58 +01:00
marchelh fdf0744fa4 siglent-sds: Added trigger position to device config code 2018-03-03 17:46:15 +01:00
marchelh e8fd027120 siglent-sds: Fixed issue with hard coded vdiv. 2018-03-03 17:46:15 +01:00
marchelh fe06061d96 siglent-sds: Drop unused variable from siglent_sds_read_header function 2018-03-03 17:45:21 +01:00
marchelh fe1aa53613 siglent-sds: Added averaging function. 2018-03-03 17:45:21 +01:00
marchelh 80eba3857a siglent-sds: Fixed timebase problem where NS could not be selected
This fixes bug #1120.
2018-03-03 17:28:49 +01:00
Frank Stettner 93497d0016 hp-3478a: Fix compiler warning. 2018-02-21 11:37:19 +01:00
Romain Tartière 6c1a76d126 Check usb_get_port_path() return value
This function can fail. If so, do not ignore the failure.
2018-02-21 11:37:19 +01:00
Romain Tartière 7bbe5a2b6a Ensure device is closed before usb_get_port_path()
The usb_get_port_path() function opens the passed device on FreeBSD,
which fails if the device has already been open.

This fixes bug #1109.
2018-02-21 11:36:58 +01:00
Gerhard Sittig dea7f6342a pce-322a: include config.h before any other header file 2018-02-21 11:19:17 +01:00
Uwe Hermann 5a64d1d954 beaglelogic: Use UINT64_MAX instead of (uint64_t)-1. 2018-02-20 20:03:21 +01:00
Uwe Hermann 71e22ba88f beaglelogic: Drop unneeded uint64_t cast. 2018-02-20 20:03:21 +01:00
Uwe Hermann 3f4c1174b6 lecroy-xstream: Fix potential issue by adding UINT64_C. 2018-02-20 20:03:21 +01:00
Uwe Hermann d9b716fc5f Use UINT64_C instead of "ULL" number suffix.
Avoid hardcoding a "ULL" number suffix, use the more portable and more
correct UINT64_C.
2018-02-20 20:03:21 +01:00
Uwe Hermann 405b9c10eb Random whitespace/cosmetic fixes. 2018-02-20 20:03:11 +01:00
Uwe Hermann 1135f8d9c7 siglent-sds: Fix two memory leaks. 2018-02-18 23:36:17 +01:00
Uwe Hermann d6d87fa2a2 siglent-sds: Drop incorrect glib includes. 2018-02-18 23:29:14 +01:00
Uwe Hermann 04c4a6776f hp-3478a: Shorten some functions. 2018-02-18 23:18:22 +01:00
Uwe Hermann 6ddedf5bac hp-3478a: Drop superfluous log message prefixes. 2018-02-18 23:13:34 +01:00
Frank Stettner d2c1730a28 hp-3478a: Initial HP 3478A diver 2018-02-18 23:13:34 +01:00
Frank Stettner 1d9eebf4be hp-3478a: Initial driver skeleton. 2018-02-18 22:59:31 +01:00
Uwe Hermann 374b0a94b2 output/analog: Fix a compiler warning on Mac OS X.
Apparently PRIu64 and G_GUINT64_FORMAT differ on some systems for
unknown reasons. Use G_GUINT64_FORMAT to get rid of the warning
for now.
2018-02-18 21:36:18 +01:00
Uwe Hermann 65788048f0 Fix two compiler warnings on MinGW/MSYS2.
The config.h file must always be included as first file.

  src/output/csv.c: In function 'gen_header':
  src/output/csv.c:64:20: warning: format '%u' expects argument of type 'unsigned int', but argument 3 has type 'uint64_t {aka long long unsigned int}' [-Wformat=]
   #define LOG_PREFIX "output/csv"
                      ^
  ./src/libsigrok-internal.h:753:42: note: in expansion of macro 'LOG_PREFIX'
   #define sr_info(...) sr_log(SR_LOG_INFO, LOG_PREFIX ": " __VA_ARGS__)
                                            ^
  src/output/csv.c:244:3: note: in expansion of macro 'sr_info'
     sr_info("Set sample period to %" PRIu64 " %s",
     ^
  src/output/csv.c: In function 'dump_saved_values':
  src/output/csv.c:462:34: warning: format '%u' expects argument of type 'unsigned int', but argument 3 has type 'uint64_t {aka long long unsigned int}' [-Wformat=]
       g_string_append_printf(*out, "%" PRIu64 "%s",
                                    ^

  In file included from src/hardware/ftdi-la/protocol.c:21:0:
  src/hardware/ftdi-la/protocol.c: In function 'send_samples':
  src/hardware/ftdi-la/protocol.h:28:20: warning: format '%u' expects argument of type 'unsigned int', but argument 3 has type 'uint64_t {aka long long unsigned int}' [-Wformat=]
   #define LOG_PREFIX "ftdi-la"
                      ^
  ./src/libsigrok-internal.h:751:42: note: in expansion of macro 'LOG_PREFIX'
   #define sr_spew(...) sr_log(SR_LOG_SPEW, LOG_PREFIX ": " __VA_ARGS__)
                                            ^
  src/hardware/ftdi-la/protocol.c:29:2: note: in expansion of macro 'sr_spew'
    sr_spew("Sending %" PRIu64 " samples.", samples_to_send);
    ^
2018-02-18 21:36:12 +01:00
Uwe Hermann e8e063738d siglent-sds: Fix multiple compiler warnings. 2018-02-18 17:40:59 +01:00
Uwe Hermann 567c6501d9 siglent-sds: Remove unused variable. 2018-02-18 17:14:08 +01:00
Frank Stettner 94b1d50642 dmm: Remove unnecessary casts 2018-02-18 17:08:06 +01:00
Frank Stettner 7fb4ff0237 metex14: Add missing modes and set correct digits value. 2018-02-18 17:08:06 +01:00
Gerhard Sittig 556a926d43 serial-dmm, metex14: add support for multiple channels per DMM
Optionally create multiple analog channels in serial-dmm's scan()
routine. Allow the meters' parse routines to fill in more than one
analog value from the inspection of a single packet.

Use "large" (4 times 14 bytes) packets for the Metex M-3860M and the
PeakTech 4390A meters, and have those large packets parsed by wrapping
the routines for regular 14-byte Metex packets, and sending four values
to the session bus after reception of one large packet.

Thanks to Frank Stettner <frank-stettner@gmx.net> for testing and
fixing the initial implementation of this extension.
2018-02-18 15:43:34 +01:00
Gerhard Sittig 51e1f5661c serial-dmm: style nit (init vs assign, memmove(3))
Move the initial assignment to the 'offset' variable to the very spot
where it gets evaluated and subsequently manipulated.

Replace a DIY copy loop with the corresponding memmove(3) call.
2018-02-18 15:43:34 +01:00
Uwe Hermann e4fb1a821d siglent-sds: Bring driver up-to-date with current code conventions.
Use ARRAY_AND_SIZE where possible, use std.c helpers where possible,
make scanopts/drvopts/devopts consistent with other drivers.
2018-02-17 19:10:19 +01:00
Uwe Hermann 8856f173df siglent-sds: Drop obsolete SR_ST_ACTIVE checks.
These are now done in the wrapper functions.
2018-02-17 19:10:19 +01:00
Uwe Hermann e5896840f6 siglent-sds: Random cosmetics, drop unused stuff. 2018-02-17 19:10:19 +01:00
Uwe Hermann 641107aa6c siglent-sds: Use PRIu64 for uint64_t variables.
This fixes various compiler warnings on some systems.
2018-02-17 16:01:58 +01:00
Uwe Hermann 2dedd64e11 siglent-sds: Fix SR_CONF_TRIGGER_SLOPE config_set() code.
Also use "r" and "f" as trigger slope values for now, since that's
what most other drivers do currently.

This also fixes two scan-build issues:

  api.c:559:3: warning: Value stored to 'tmp_str' is never read
                  tmp_str = g_variant_get_string(data, NULL);
                  ^         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  api.c:561:9: warning: Use of memory after it is freed
                  ret = siglent_sds_config_set(sdi, "%s:TRSL %s",
                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2018-02-17 00:51:53 +01:00
Uwe Hermann 70cfec9a14 siglent-sds: Add 100s timebase (seen on e.g. SDS1202X-E). 2018-02-17 00:51:53 +01:00
Uwe Hermann afcbb911f8 siglent-sds: Add SDS1052DL+ model. 2018-02-17 00:51:53 +01:00
Uwe Hermann 3e7fb88f21 siglent-sds: Various cosmetics and coding-style fixes.
Also, drop some unneeded comments and log messages.
2018-02-17 00:51:53 +01:00
Uwe Hermann 4868f15a86 hantek-4032l: Minor cosmetics. 2018-02-15 22:45:35 +01:00
Uwe Hermann d18bf7bdfc std.c: Add missing <sys/time.h> #include and _XOPEN_SOURCE.
This is required for gettimeofday() to be available (at least on
FreeBSD), causes compiler warnings otherwise.
2018-02-13 23:10:33 +01:00
Uwe Hermann a9a38e7511 siglent-sds: Replace non-portable strcasestr() with g_strstr_len().
The strcasestr() function is non-portable (e.g. not available on
MinGW, possibly elsewhere). Replace it with g_strstr_len() for the time
being. While the latter is not case-insensitive it appears that
that property doesn't matter here ("." should not be relevant anyway,
and e.g. an SDS1202X-E does indeed report "Mpts" as such).

Should it become necessary to have this code be case-insensitive,
we'll have to find a more portable solution than strcasestr().
2018-02-13 22:45:22 +01:00
Uwe Hermann 04fe775be6 siglent-sds: Drop currently unused <rpc/rpc.h> #include.
This causes some compile errors on platforms where RPC is not available, e.g.

  siglent-sds/api.c:25:21: fatal error: rpc/rpc.h: No such file or directory

Surrounding the #include (and later code) with "#if HAVE_RPC" should avoid
these compile errors, but since it's not used at all for now, drop it.
2018-02-13 22:09:58 +01:00
Gerhard Sittig 7a970e3170 usbtmc: only reset Siglent (and Atten) devices in open
Make the USB reset for USB TMC devices conditional. Check a whitelist,
which in this implementation exclusively contains the Siglent VID.

The whitelist's comment may need adjustment. The VID probably not only
applies to SDS devices, but could be used for SDG and others as well.
And lsusb output suggests the VID is used by Atten, too.
2018-02-12 00:13:49 +01:00
Gerhard Sittig 9a4cc7dd38 usbtmc: add the Siglent VID and reset USB devices in open
Add the Siglent's VID to a list of blacklisted USB TMC devices.
Unconditionally reset USB devices in the open routine.

This was taken from marchel's development for Siglent SDS. Though the
reset should probably be conditional, and only get applied to devices
which are known to need it.

The comment may need adjustment, maybe individual PID entries are
required. The VID probably not only applies to SDS devices, but could
be used for SDG and other gear as well. And lsusb output suggests the
VID is used by Atten, too.
2018-02-12 00:13:49 +01:00
mhooijboer b33606718c siglent-sds: initial driver implementation for Siglent SDS
Implement a first version of the driver for the Siglent SDS1000 and
SDS2000 oscilloscopes.

[ gsi: This commit corresponds to git 0228126017e6 of marchelh's tree,
  I adjusted the source to closer match the project's coding style. The
  conversion was verified by this command:

  $ git diff --word-diff=color -w -b <branch>:<dir> <branch>:<dir>

  Changes include: Whitespace adjustment, dead code removal, separation
  of variable declaration and assignment, alpha-sorted includes. Line
  length was not addressed and not every location got adjusted, to keep
  the diff minimal and to reduce effort during review of this version. ]
2018-02-12 00:13:49 +01:00
mhooijboer 89f5fab97c siglent-sds: Initial driver skeleton. 2018-02-12 00:13:49 +01:00
Frank Stettner a7e48f3c06 korad-kaxxxxp: Simplify korad_kaxxxxp_receive_data() event loop function. 2018-02-11 23:16:37 +01:00
Frank Stettner 8f39d5698d korad-kaxxxxp: Use locale independent sr_snprintf_ascii() function 2018-02-11 23:15:52 +01:00
Frank Stettner 3f9b48ae5f korad-kaxxxxp: Synchronize read and write operations. 2018-02-11 23:15:52 +01:00
Frank Stettner 23165d7bb2 korad-kaxxxxp: Add two channels "V" and "I", remove channel "CH1" 2018-02-11 23:15:52 +01:00
Frank Stettner 79034d4f39 strutil: Locale independent snprintf() and vsnprintf() functions 2018-02-11 23:15:39 +01:00
Gerhard Sittig eac9fcd268 hameg-hmo: fix potential NULL dereference
Check for successful allocation before accessing struct members. Return
with an error from device initialization when allocation fails.

This was reported by clang's scan-build.
2018-02-10 15:34:20 +01:00
Gerhard Sittig addbb09bf8 hameg-hmo: fix potential memory leak
Make sure to release the allocated "pod enabled" memory, too, when SCPI
communication during channel setup fails. Defer the return with an error
(instead of duplicating the free() invocation).

This was reported by clang's scan-build.
2018-02-10 15:34:01 +01:00
Gerhard Sittig f396351704 output/srzip: fix potential "use after free"
The compiler marks a potential use after free, which the current
implementation won't trigger. The error only occurs when a sigrok
channel is neither logic nor analog.

Address the issue nevertheless, to silence the compiler warning, and to
protect against possible programming errors when a future implementation
should support more channel types.

This was reported by clang's scan-build.
2018-02-10 15:33:23 +01:00
Gerhard Sittig 499f5045dd session: fix another potential memory leak
This was reported by clang's scan-build.
2018-02-10 15:32:03 +01:00
Gerhard Sittig 972398f471 output/wav: fixup coding style nits, adjust data types
Fixup unbalanced braces for more complex if statements, to better
reflect the project's official coding style.

Adjust data types in the float_to_le() routine. A float value gets
copied to a buffer of bytes (uint8_t). Don't use 'char' on the other
side of assignments, to not assume a specific width for char, and to
avoid potential signedness issues. Copy from bytes to bytes instead.
2018-02-09 22:40:58 +01:00
Gerhard Sittig 23eeac46ed output/wav: change default for scale factor from 0.0 to 1.0
The WAV output module supports an optional 'scale' factor, in its
absence the samples will pass unmodified. The builtin help text is
unexpected, and reads:

  $ sigrok-cli -O wav --show
  ...
  Options:
    scale: Scale values by factor (default 0.0)

Setup a default scale factor of 1.0, which results in identical
behaviour and better reflects what is happening.
2018-02-09 22:40:58 +01:00
Gerhard Sittig aa0979482f output/vcd: assume packed input data image, unbreak 2nd+ channel
The previous implementation only emitted data for the first enabled
channels, and "saw no changes" after emission of the initial value for
channels on positions that followed a disabled channel.

Assume that the received data from the session bus communicates the bits
of enabled channels in a packed representation. Skip the mapping of
output bit indices to sigrok channel numbers.

This fixes the remaining part of bug #519.

Tested by inspecting in gtkwave the result of command:
  $ sigrok-cli -d demo -C D1,D3,D6 -c samplerate=2M --samples 2500 -O vcd -o trace.vcd

When we find that all input sources (device drivers, and input modules)
provide a dense bit field, all of the mapping logic can get removed
here. This commit just quickly disables the logic.
2018-02-09 22:40:58 +01:00
Gerhard Sittig a299a95413 output/vcd: assign adjacent names to enabled channels
Identifiers for channels in the VCD header section could be "sparse"
when sigrok channels were disabled. Make sure to not assign names to
disabled channels. This will e.g. assign !, ", and # to channels D1, D3,
and D6, when D0, D2, D4-D5, and D7 are disabled.

This addresses part of bug #519.
2018-02-09 22:40:58 +01:00
Gerhard Sittig 64aa214a22 several DMMs: set DC flag for diode mode
Few DMM drivers already did it. This commit adjusts the remaining DMM
drivers, to set the "DC" flag for measurements in diode mode.

This fixes bug #144.

Although I don't have the hardware to test, the nature of the change and
the arrangement of driver code suggests it's good. When a meter already
communicated the "DC" status, the change does nothing and won't harm.
The change ensures "DC" is flagged for those meters which previously
didn't, which is desirable.
2018-02-09 22:40:58 +01:00
Gerhard Sittig b8278e0943 strutil: accept trailing whitespace after number text
Some SCPI based drivers fail to convert response data, because strutil
conversion helpers sr_atol() and sr_atof() don't like trailing spaces
after the number's text that successfully got converted.

It's yet to get determined whether all call sites of the conversion
routines like their eating adjacent whitespace. But given that the
conversion routine explicitly checks for end of the string after the
number, no call site should expect or even depend on trailing text to
keep its whitespace.

See bug #788 for a discussion and example data.
2018-02-09 22:40:58 +01:00
Gerhard Sittig 751ba4c8ed strutil: support tera/peta/exa suffixes in symbolic size specs
Synchronize sr_parse_sizestring() with sr_si_string_u64() capabilities.
Add support for the T/P/E suffixes. Since this conversion helper deals
with integer values exclusively, there is no issue with case insensitive
matches. The value cannot be pico. Neither is there an ambiguity with
the 10e6 notation.

This addresses bug #763.

Fix a style nit while we are here. Put braces around both arms of a
complex conditional.
2018-02-09 22:40:50 +01:00
Gerhard Sittig 57a88297dd beaglelogic: silence compiler warning
Explicitly assign NULL to param to avoid the "may be used uninitialized"
warning reported in bug #1094. Behaviour remains unchanged. All references
to the variable were under "if (!conn)", and the assigning arm of the
branch checked for "if (!param)" after assignment. So the error could
not happen, but compilers may not have noticed depending on the width of
their scope during compilation.

Move the initialization of 'conn' closer to the conditional assignment,
such that all paths are seen in one spot during maintenance.

This fixes bug #1094.
2018-02-09 21:59:18 +01:00
Gerhard Sittig 6f63b1ee67 usb: re-use existing values, don't re-determine bus and device address
Avoid repeated libusb bus number and device address retrieval operations,
instead use variables where the information previously got stored to.
2018-02-09 21:59:18 +01:00
Gerhard Sittig 241c03029d log: flush log lines, to cope with non-terminal output (pipes)
Although log messages are terminated by a line feed, output still might
get buffered when the program does not talk to a terminal (that it is
aware of). Add an fflush(3) call to the printf(3) sequence such that log
output will immediately show up when writing to pipes or sockets, too.
2018-02-09 21:59:18 +01:00
Gerhard Sittig 928560e6f5 backend: fixup resource leak in sr_init() error code path
Early sr_init() steps can just 'return' fine. After allocation of the
'context' memory, make all error paths 'goto done' before returning,
to undo the memory allocation.
2018-02-09 21:59:18 +01:00