Commit graph

166 commits

Author SHA1 Message Date
Anders Blomdell
2b8c2f8087 comedi_open has file descriptor leak
If something fails after a succesful open, cleanup fails to close the file.

The code

   cleanup:
         if(it)
                 free(it);

needs to be replaced with something like:

   cleanup:
         if (it) {
           if (it->fd >= 0) {
             close(it->fd);
           }
         free(it);

Regards

Anders Blomdell
2012-08-22 09:54:19 +01:00
Ian Abbott
2665ee5627 libcomedi: don't ignore channel in comedi_set_clock_source()
Fix bug reported by Finn Hoffman on comedi email list.
2011-12-01 15:37:43 +00:00
Ian Abbott
c530564317 #include <sys/stat.h> needed for fstat(). 2011-01-05 15:02:44 +00:00
Ian Abbott
b8a4f1a265 Added channel parameter to comedi_set_clock_source() and
comedi_get_clock_source().  Bumped library version to 0.10.0.
2010-03-19 13:44:56 +00:00
Ian Abbott
b06cecc151 comedi_find_range() should skip ranges that don't match specified units. 2010-02-17 18:28:15 +00:00
Ian Abbott
12eedd26b3 comedi_get_default_calibration_path(): Check result of asprintf() for error. 2009-02-18 15:35:09 +00:00
Ian Abbott
f2fdf25018 Move "comedi_errno.h" into "include/" and install it. 2009-02-18 14:47:06 +00:00
Ian Abbott
76a2e658b7 Put __comedi_errno variable into thread-local storage if the compiler
supports it.  Configuration test uses Alan Woodland's 'ax_tls.m4' from
<http://autoconf-archive.cryp.to/ax_tls.html>.
2009-02-18 14:10:54 +00:00
Ian Abbott
564e9680b0 Fixed do_test_for_insn_bits(), broken by validity checks added to
comedi_do_insnlist().  Call comedi_ioctl() instead of comedi_do_insnlist().
2008-12-18 17:23:14 +00:00
Ian Abbott
9a06deb6f9 Removed unneeded comedi_insnlist from do_test_for_insn(). 2008-12-18 16:44:20 +00:00
Ian Abbott
d8c3b29ca4 Corrected the 'BUG' message in do_test_for_insnlist() (it reported the
wrong function).
2008-12-18 16:38:51 +00:00
Ian Abbott
4df5ffd451 Added some device and subdevice validity checks. 2008-11-05 12:52:25 +00:00
Frank Mori Hess
8103c5334a Updated it to only run the (unreliable) do_test_for_insn_bits() if the
information was not available in the subdevice info.
2008-09-16 14:49:35 +00:00
Frank Mori Hess
b94b2ba024 Fixed memory leak in comedi_cleanup_calibration(). 2008-08-29 19:17:40 +00:00
Ian Abbott
64f8e05331 Fix some 64-bit warnings. 2008-04-23 18:53:09 +00:00
Frank Mori Hess
d0956ca8b5 Added comedi_get_hardware_buffer_size() wrapper function, and made
comedi_strerror return a const char*.
2008-03-28 15:56:35 +00:00
Frank Mori Hess
e0b0b89338 Allow comedi_cleanup_calibration to accept a NULL argument. 2008-03-14 17:52:20 +00:00
Frank Mori Hess
0695475797 Updated comedi_dio_config implementation to reflect logical split
between COMEDI_INPUT/COMEDI_OUTPUT and corresponding config insn ids
(even though they still have the same value).  Made comedi_dio_config
return 0 on success for better consistency in API.
2008-02-12 18:27:00 +00:00
Frank Mori Hess
0c69850ffc Made comedi_ioctl take its third argument as a void* instead of
and integer type, and got rid of a bunch of casts (and added a few).
2008-02-12 01:12:46 +00:00
Frank Mori Hess
a61ed59402 Fixed return values from comedi_mark_buffer_read/written(). Removed
some redundant assignments of __comedi_errno
2008-02-11 20:50:14 +00:00
Frank Mori Hess
a06bba542a Added more INSN_CONFIG wrappers: comedi_get_clock_source(),
comedi_get_gate_source(), and comedi_get_routing().  Added "channel"
parameter to some of the INSN_CONFIG wrappers.
2008-01-23 18:56:52 +00:00
Frank Mori Hess
76791bfeed Added comedi_set_filter() and comedi_set_routing() configuration
instruction wrappers.
2008-01-18 16:37:32 +00:00
Ian Abbott
1979b2f2cc More memory initialization, error detection and cleanup in get_subdevices()
and get_rangeinfo().
2008-01-17 13:52:02 +00:00
Ian Abbott
625d44af04 Free elements of rangeinfo_list on close. 2008-01-17 13:50:32 +00:00
Frank Mori Hess
37dc388297 Return 0 from the INSN_CONFIG wrappers on success. 2008-01-16 20:09:38 +00:00
Frank Mori Hess
ebe72a2b2a Added more memory initialization for the sake of valgrind (especially
memory that gets set by ioctls that valgrind can't see).  Added a little
error handling for a few memory allocations.
2008-01-16 19:45:05 +00:00
Frank Mori Hess
4d07ce9969 Moved some wrappers for INSN_CONFIG instructions into comedilib.
Will add some reference documentation for the new functions soon.
2008-01-15 21:01:40 +00:00
Ian Abbott
0b21f80783 Avoid mixing declarations and code. 2007-12-10 13:20:19 +00:00
Frank Mori Hess
f87490e0f6 Fixed setting of comedi_errno in comedi_dio_config() for invalid
arguments.
2007-12-01 15:54:08 +00:00
Frank Mori Hess
792e4b741f Got rid of obsolete error codes. 2007-12-01 15:53:18 +00:00
Frank Mori Hess
1081d0ff02 Gave libscxi independent version info from libcomedi. Removed
attempt to link to libcomedi when building libscxi.
2007-08-19 18:30:26 +00:00
Frank Mori Hess
c1082cee65 Fixed comedi_get_cmd_generic_timed() by adding a chanlist_len
parameter.  Old version is still available in library, thanks to the
magic of the version_script.
2007-08-02 19:46:44 +00:00
Frank Mori Hess
2b04263bed Actually, according to current:revision:age practice, the next
release should be 0.8.0 since new functions have been added since
0.7.22.
2007-07-31 02:44:29 +00:00
Frank Mori Hess
8d74d571b3 Move to current:revision:age discipline for library version numbers.
Bumped version for next release.
2007-07-31 02:21:24 +00:00
Ian Abbott
06fa9b06b1 Add calib_lex.h to noinst_HEADERS. 2007-07-24 13:38:14 +00:00
Frank Mori Hess
c80870a4a6 Fixed compile warning under gcc 4.1.2 2007-04-18 14:04:39 +00:00
Frank Mori Hess
34b9800e40 Added const qualifiers to some char* return values. Added new
experimental comedi_dio_bitfield2() function which works with
> 32 channels.  Only works properly with ni_65xx currently.
Will post a request for review by any interested
parties to list before I bother making the rest of the drivers
work with it.
2006-10-17 18:19:29 +00:00
Frank Mori Hess
1421d0919e Added some primative support for using software calibration in a way
that can be integrated with boards that don't use software calibrations.
2006-09-07 19:09:04 +00:00
Frank Mori Hess
881600a31e Fill in inverse polynomials for first order soft calibrations. 2006-08-31 18:09:27 +00:00
Frank Mori Hess
e48a8d91df Added flex and bison generated files to MAINTAINERCLEANFILES 2006-08-31 15:29:44 +00:00
Frank Mori Hess
a186b9a33c Fix parsing of floating point values in exponential notation, and numbers
with a leading + or - sign (untested).
2006-08-28 22:59:42 +00:00
Frank Mori Hess
29358e699f Fixed problem with keeping track of whether a software calibration
is for the from_phys or to_phys direction.
2006-08-22 20:19:19 +00:00
Frank Mori Hess
4f26b59efc Parsing of calibration file with soft calibration information works now. 2006-08-22 20:13:44 +00:00
Frank Mori Hess
d686d1278f First pass at parsing additional calibration file elements which
support software calibration.
2006-08-22 18:14:22 +00:00
Bernd Porr
47450e4387 Creates the proper so-version defined in configure.ac. 2005-06-07 23:27:00 +00:00
Frank Mori Hess
58a2e315df return errors properly in comedi_mark_buffer_read() and
comedi_mark_buffer_written()
2005-04-25 21:43:37 +00:00
Frank Mori Hess
4f670c0248 fix for comedi_get_generic_timed() from Jan Gukelberger <g.u.g.i@gmx.de> 2005-04-25 21:41:48 +00:00
David Schleef
19442d5d06 Ugh, fix the soname problem 2005-04-07 22:36:05 +00:00
Frank Mori Hess
4d7d679826 updated version of comedi_get_subdevice_flags() which is capable of
returning dynamic flags like SDF_RUNNING or SDF_BUSY
2005-03-16 19:04:59 +00:00
Frank Mori Hess
2a720182e4 added comedi_dio_get_config() 2005-03-06 17:42:56 +00:00