debian/0000775000000000000000000000000012237525675007206 5ustar debian/watch0000664000000000000000000000017012060740477010226 0ustar version=3 opts="dversionmangle=s/\+dfsg\d+$//" \ http://www.digitemp.com/software.shtml .*?/digitemp-([\d.]*?)\.tar\.gz debian/README.Debian0000664000000000000000000000107111743045744011241 0ustar digitemp for Debian ------------------- In order to use this software as a normal user, you have to add the desired users to the group dialout, which grants that user access to the serial ports. This debian release includes three executables from upstream: digitemp_DS9097, digitemp_DS9097U and digitemp_DS2490 in order to support all adapters: passive serial, active serial (DS9097U) and USB (DS2490). It does not install any executable named digitemp as it used in older upstream versions. -- Jesús Roncero , Wed, 01 Sep 2004 01:45:00 +0200 debian/control0000664000000000000000000000163712237522450010604 0ustar Source: digitemp Section: electronics Priority: optional Maintainer: Ryan Finnie Build-Depends: debhelper (>= 7.0.50~), libusb-dev Standards-Version: 3.9.4 Homepage: http://www.digitemp.com Vcs-Browser: https://code.launchpad.net/~fo0bar/digitemp/digitemp-pkg-debian Vcs-Bzr: http://bazaar.launchpad.net/~fo0bar/digitemp/digitemp-pkg-debian Package: digitemp Architecture: any Suggests: rrdtool, python, mysql-server Depends: ${shlibs:Depends}, ${misc:Depends} Description: read temperature sensors in a 1-Wire net Digitemp is a program that reads data coming from a 1-Wire network using a passive adapter (DS9097) or the newer active adapter (DS9097U), connected to a serial port. It also supports reading from USB adaptors like the DS2490. Basically it reads temperature sensors, but others are supported, like a humidity sensor. . Digitemp also supports branched networks using DS2409 couplers. debian/rules0000775000000000000000000000324112061003511010235 0ustar #!/usr/bin/make -f # -*- makefile -*- # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 # Turn off optimizations on AMD64 to avoid breaking DS2490 # (Debian Bug #585431, LP: #452177) ifneq (,$(filter amd64,$(DEB_HOST_ARCH_CPU))) DEB_CFLAGS_MAINT_STRIP="-O2" DEB_CFLAGS_MAINT_PREPEND="-O0" endif CPPFLAGS:=$(shell dpkg-buildflags --get CPPFLAGS) CFLAGS:=$(shell DEB_CFLAGS_MAINT_STRIP="$(DEB_CFLAGS_MAINT_STRIP)" DEB_CFLAGS_MAINT_PREPEND="$(DEB_CFLAGS_MAINT_PREPEND)" dpkg-buildflags --get CFLAGS) CXXFLAGS:=$(shell dpkg-buildflags --get CXXFLAGS) LDFLAGS:=$(shell dpkg-buildflags --get LDFLAGS) %: dh $@ override_dh_auto_build: mkdir -p build-serial/src build-serial/userial/ds9097 build-serial/userial/ds9097u $(MAKE) -C build-serial -f ../Makefile CFLAGS="$(CFLAGS)" CPPFLAGS="$(CPPFLAGS)" LDFLAGS="$(LDFLAGS)" SRCDIR=.. ds9097 ds9097u mkdir -p build-usb/src build-usb/userial/ds2490 $(MAKE) -C build-usb -f ../Makefile CFLAGS="$(CFLAGS)" CPPFLAGS="$(CPPFLAGS)" LDFLAGS="$(LDFLAGS)" SRCDIR=.. ds2490 override_dh_auto_install: install -m 0755 -d debian/digitemp/usr/bin install -m 0755 build-serial/digitemp_DS9097 debian/digitemp/usr/bin install -m 0755 build-serial/digitemp_DS9097U debian/digitemp/usr/bin install -m 0755 build-usb/digitemp_DS2490 debian/digitemp/usr/bin override_dh_installman: dh_installman digitemp.1 dh_link usr/share/man/man1/digitemp.1.gz usr/share/man/man1/digitemp_DS9097.1.gz dh_link usr/share/man/man1/digitemp.1.gz usr/share/man/man1/digitemp_DS9097U.1.gz dh_link usr/share/man/man1/digitemp.1.gz usr/share/man/man1/digitemp_DS2490.1.gz override_dh_auto_clean: rm -rf build-serial rm -rf build-usb $(MAKE) clean dh_clean debian/compat0000664000000000000000000000000211743045744010377 0ustar 7 debian/README.source0000664000000000000000000000035712060734437011362 0ustar The base tarball has been modified from upstream to remove compiled binaries. The following files and directories have been removed: digitemp_DS2490 digitemp_DS9097 digitemp_DS9097U win/digitemp_DS9097U.exe win/digitemp_DS9097.exe win/ debian/copyright0000664000000000000000000001245511743045744011143 0ustar This package was debianized by Jesús Roncero on Fri, 23 Jul 2004 10:27:19 +0200. It was downloaded from http://www.digitemp.com/software.shtml Upstream Author: Brian C. Lane Copyright: Copyright (C) 1996-2007 by Brian C. Lane. License: This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. Please see /usr/share/common-licenses/GPL-2 for the full license. All files under userial/ Copyright (C) 1999-2000 Dallas Semiconductor Corporation All Rights Reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL DALLAS SEMICONDUCTOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of Dallas Semiconductor shall not be used except as stated in the Dallas Semiconductor Branding Policy. except userial/ds9070/linux{lnk,ses}.c Copyright (c) 2003, Erik Rigtorp All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of Erik Rigtorp nor the names of his contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. and userial/ds2490/usb{lnk,ses}.c Copyright (C) 2001 Matthew Dharm, All Rights Reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL DALLAS SEMICONDUCTOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. The Debian packaging is (C) 2008, Riccardo Stagni and is licensed under the GPL, see `/usr/share/common-licenses/GPL'. debian/docs0000664000000000000000000000005111743045744010050 0ustar perl CREDITS README TODO rrdb FAQ python debian/dirs0000664000000000000000000000001011743045744010054 0ustar usr/bin debian/source/0000775000000000000000000000000012060750077010474 5ustar debian/source/format0000664000000000000000000000001411743153726011707 0ustar 3.0 (quilt) debian/source/options0000664000000000000000000000014612060750077012113 0ustar # Ignore VCS files (non-native packages) diff-ignore # Ignore VCS files (native packages) #tar-ignore debian/changelog0000664000000000000000000000600112237525673011053 0ustar digitemp (3.6.0+dfsg1-2) unstable; urgency=low * Replace lockdev usage with flock (Closes: #728018) * Bump standards version to 3.9.4, no change -- Ryan Finnie Sat, 09 Nov 2013 21:40:03 +0000 digitemp (3.6.0+dfsg1-1) unstable; urgency=low * Digitemp 3.6.0 (binaries removed) (Closes: #579313) * Add hardening compilation * Add README.source, explaining tarball rebuild * Remove XS-Dm-Upload-Allowed (no longer used) * Version control debian/ (bzr) * Turn off optimizations on AMD64 to avoid breaking DS2490 (Closes: #585431) (LP: #452177) * Flush logs when running non-interactive (Closes: #691069) -- Ryan Finnie Sun, 09 Dec 2012 19:03:19 -0800 digitemp (3.5.0ds1-2) unstable; urgency=low * Change maintainer to Ryan Finnie, with the blessing of Riccardo Stagni (Closes: #668334) * Bump standards version to 3.9.3, Lintian cleanup - Change "dh_clean -k" to "dh_prep" - Add stub build-arch and build-indep targets - Spelling, manpage corrections * Increase length of /dev path to 1023 chars (LP: #978294) * Update debian/watch * Migrate to unified debhelper * Migrate to source format 3.0 (quilt) -- Ryan Finnie Mon, 16 Apr 2012 20:31:27 -0700 digitemp (3.5.0ds1-1) unstable; urgency=low * Taking over Jesus Roncero in maintainership with his permission * New upstream release (Closes: #474031) (repackaged as the upstream tarball contained the compiled programs, also for Windows. The resulting .tar.gz is about half of the original size) * Debian packaging remade from scratch - Acknowledge NMU (Closes: #461576) - debhelper compatibility switched to 7 (previous level undefined) * formatting issues in the digitemp.1 manpage (Closes: #350809) (also fixes a lintian's warning, thanks to Nicolas François for the patch) * Bumped standard version to 3.8.0 - debian/control: Moved Homepage field from description to source section - updated DEB_BUILD_OPTIONS support to debian/rules - adjusted Makefile so we can tweak CFLAGS from debian/rules -- Riccardo Stagni Fri, 18 Jul 2008 00:33:07 +0200 digitemp (3.3.2-2.1) unstable; urgency=low * Non-maintainer upload. * Removed bashisms from debian/rules (use of {,}). Closes: #315599, #379489. -- Lucas Nussbaum Sat, 19 Jan 2008 17:15:48 +0100 digitemp (3.3.2-2) unstable; urgency=low * Added digitemp_DS2490. Patch created by Mikael Mikael Magnusson (Closes: bug#269246). * Build digitemp for serial and usb adapters in separate build directories, since they need different CFLAGS. Thanks to Mikael Magnusson. * Flush output after each line. Patch added by Mikael Magnusson. * Updated suggests to mysql-server (Closes: bug#269207). * Updated watch file. -- Jesus Roncero Wed, 01 Sep 2004 01:34:37 +0200 digitemp (3.3.2-1) unstable; urgency=low * Initial release (Closes: bug#226890). -- Jesus Roncero Fri, 23 Jul 2004 10:27:19 +0200 debian/patches/0000775000000000000000000000000012237525257010631 5ustar debian/patches/digitemp-3.6.0+dfsg1-devlength.patch0000664000000000000000000000212112060733556017065 0ustar Change /dev max name length from 40 (39) chars to 1024 (1023) Patch author: Ryan Finnie Permanent mappings in /dev can become quite long, for example: /dev/serial/by-id/usb-FTDI_FT232R_USB_UART_A800bZvc-if00-port0 This patch increases the maximum usable length to 1023 character. Originally reported to Ubuntu: https://bugs.launchpad.net/bugs/978294 Will be sent upstream. diff -ruN digitemp-3.6.0.dfsg.1.orig/src/digitemp.c digitemp-3.6.0.dfsg.1/src/digitemp.c --- digitemp-3.6.0.dfsg.1.orig/src/digitemp.c 2008-08-27 21:42:48.000000000 -0700 +++ digitemp-3.6.0.dfsg.1/src/digitemp.c 2012-12-08 13:39:14.528173928 -0800 @@ -159,8 +159,8 @@ extern const char dtlib[]; /* Library Used */ -char serial_port[40], /* Path to the serial port */ - tmp_serial_port[40], +char serial_port[1024], /* Path to the serial port */ + tmp_serial_port[1024], serial_dev[40], /* Device name without /dev/ */ log_file[1024], /* Path to the log file */ tmp_log_file[1024], debian/patches/digitemp-3.6.0+dfsg1-makefile.patch0000664000000000000000000000501412061005516016653 0ustar Makefile adjustments Patch author: Ryan Finnie * Allow CFLAGS to be applied on the command line * Use LDFLAGS whe building the final binaries --- a/Makefile +++ b/Makefile @@ -11,8 +11,15 @@ VERSION = 3.6.0 -CC = gcc -CFLAGS = -I./src -I./userial -O2 -Wall # -g +SRCDIR = $(CURDIR) +VPATH = $(SRCDIR) + +# May be overridden by the command line +CFLAGS = -O2 -Wall # -g + +# Mandatory additions to CFLAGS +EXTRACFLAGS = -I$(SRCDIR)/src -I$(SRCDIR)/userial +override CFLAGS += $(EXTRACFLAGS) OBJS = src/digitemp.o src/device_name.o src/ds2438.o HDRS = src/digitemp.h src/device_name.h @@ -48,7 +55,7 @@ SYSTYPE := $(shell uname -s) ifeq ($(SYSTYPE), Linux) - CFLAGS += -DLINUX + EXTRACFLAGS += -DLINUX # Set LOCK to yes for serial port locking support LOCK = no @@ -56,44 +63,44 @@ endif ifneq (, $(findstring CYGWIN,$(SYSTYPE))) - CFLAGS += -DCYGWIN + EXTRACFLAGS += -DCYGWIN LIBS += -static -static-libgcc endif ifeq ($(SYSTYPE), SunOS) - CFLAGS += -DSOLARIS + EXTRACFLAGS += -DSOLARIS LIBS += -lposix4 endif ifeq ($(SYSTYPE), FreeBSD) - CFLAGS += -DFREEBSD + EXTRACFLAGS += -DFREEBSD endif ifeq ($(SYSTYPE), OpenBSD) - CFLAGS += -DOPENBSD + EXTRACFLAGS += -DOPENBSD endif # Untested, but should work. ifeq ($(SYSTYPE), NetBSD) - CFLAGS += -DNETBSD + EXTRACFLAGS += -DNETBSD endif ifeq ($(SYSTYPE), Darwin) - CFLAGS += -DDARWIN + EXTRACFLAGS += -DDARWIN endif ifeq ($(SYSTYPE), AIX) - CFLAGS += -DAIX + EXTRACFLAGS += -DAIX endif ifeq ($(LOCK), yes) - CFLAGS += -DLOCKDEV + EXTRACFLAGS += -DLOCKDEV LIBS += -llockdev endif # USB specific flags -ds2490: CFLAGS += -DOWUSB +ds2490: EXTRACFLAGS += -DOWUSB ds2490: LIBS += -lusb @@ -116,13 +123,13 @@ # Build the Linux executable ds9097: $(OBJS) $(HDRS) $(ONEWIREOBJS) $(ONEWIREHDRS) $(DS9097OBJS) - $(CC) $(OBJS) $(ONEWIREOBJS) $(DS9097OBJS) -o digitemp_DS9097 $(LIBS) + $(CC) $(OBJS) $(ONEWIREOBJS) $(DS9097OBJS) -o digitemp_DS9097 $(LDFLAGS) $(LIBS) ds9097u: $(OBJS) $(HDRS) $(ONEWIREOBJS) $(ONEWIREHDRS) $(DS9097UOBJS) - $(CC) $(OBJS) $(ONEWIREOBJS) $(DS9097UOBJS) -o digitemp_DS9097U $(LIBS) + $(CC) $(OBJS) $(ONEWIREOBJS) $(DS9097UOBJS) -o digitemp_DS9097U $(LDFLAGS) $(LIBS) ds2490: $(OBJS) $(HDRS) $(ONEWIREOBJS) $(ONEWIREHDRS) $(DS2490OBJS) - $(CC) $(OBJS) $(ONEWIREOBJS) $(DS2490OBJS) -o digitemp_DS2490 $(LIBS) + $(CC) $(OBJS) $(ONEWIREOBJS) $(DS2490OBJS) -o digitemp_DS2490 $(LDFLAGS) $(LIBS) # Clean up the object files and the sub-directory for distributions debian/patches/series0000664000000000000000000000042012237516574012044 0ustar digitemp-3.6.0+dfsg1-banner-version.patch digitemp-3.6.0+dfsg1-code-spelling.patch digitemp-3.6.0+dfsg1-devlength.patch digitemp-3.6.0+dfsg1-makefile.patch digitemp-3.6.0+dfsg1-flush-stdout.patch digitemp-3.6.0+dfsg1-format-security.patch digitemp-3.6.0+dfsg1-flock.patch debian/patches/digitemp-3.6.0+dfsg1-flock.patch0000664000000000000000000001211312237525257016210 0ustar Replace lockdev usage with flock Patch author: Ryan Finnie http://bugs.debian.org/728018 Index: digitemp-3.6.0+dfsg1/Makefile =================================================================== --- digitemp-3.6.0+dfsg1.orig/Makefile 2013-11-09 20:23:28.000000000 +0000 +++ digitemp-3.6.0+dfsg1/Makefile 2013-11-09 20:52:58.118965186 +0000 @@ -6,8 +6,6 @@ # # Please note that this Makefile *needs* GNU make. BSD make won't do. # -# To disable Lockfile support on Linux, chenage LOCK to no -# VERSION = 3.6.0 @@ -56,10 +54,6 @@ ifeq ($(SYSTYPE), Linux) EXTRACFLAGS += -DLINUX - - # Set LOCK to yes for serial port locking support - LOCK = no - endif ifneq (, $(findstring CYGWIN,$(SYSTYPE))) @@ -93,11 +87,6 @@ EXTRACFLAGS += -DAIX endif -ifeq ($(LOCK), yes) - EXTRACFLAGS += -DLOCKDEV - LIBS += -llockdev -endif - # USB specific flags ds2490: EXTRACFLAGS += -DOWUSB Index: digitemp-3.6.0+dfsg1/src/digitemp.c =================================================================== --- digitemp-3.6.0+dfsg1.orig/src/digitemp.c 2013-11-09 20:23:28.000000000 +0000 +++ digitemp-3.6.0+dfsg1/src/digitemp.c 2013-11-09 20:54:24.318993659 +0000 @@ -86,14 +86,6 @@ #include #endif -#ifdef LINUX -#ifndef OWUSB -#ifdef LOCKDEV -#include -#endif -#endif -#endif - #include "digitemp.h" #include "device_name.h" #include "ownet.h" @@ -2658,46 +2650,6 @@ exit(EXIT_NOPERM); } - - /* Lock our use of the serial port, exit if it is in use */ -#ifdef LINUX -#ifndef OWUSB -#ifdef LOCKDEV - /* First turn serial_port into just the final device name */ - if( !(p = strrchr( serial_port, '/' )) ) - { - fprintf( stderr, "Error getting serial device from %s\n", serial_port ); - - if( sensor_list.roms != NULL ) - free( sensor_list.roms ); - - if( coupler_top != NULL ) - free_coupler(1); - - exit(EXIT_DEVERR); - } - strncpy( serial_dev, p+1, sizeof(serial_dev)-1 ); - - if( (pid = dev_lock( serial_dev )) != 0 ) - { - if( pid == -1 ) - { - fprintf( stderr, "Error locking %s. Do you have permission to write to /var/lock?\n", serial_dev ); - } else { - fprintf( stderr, "Error, %s is locked by process %d\n", serial_dev, pid ); - } - - if( sensor_list.roms != NULL ) - free( sensor_list.roms ); - - if( coupler_top != NULL ) - free_coupler(1); - - exit(EXIT_LOCKED); - } -#endif /* LOCKDEV */ -#endif /* OWUSB */ -#endif /* LINUX */ #endif /* !OWUSB */ /* Connect to the MLan network */ @@ -2719,13 +2671,6 @@ if( coupler_top != NULL ) free_coupler(0); -#ifdef LINUX -#ifndef OWUSB -#ifdef LOCKDEV - dev_unlock( serial_dev, 0 ); -#endif /* LOCKDEV */ -#endif /* OWUSB */ -#endif /* LINUX */ exit(EXIT_ERR); } @@ -2747,14 +2692,6 @@ owRelease(0, temp ); #endif /* OWUSB */ -#ifdef LINUX -#ifndef OWUSB -#ifdef LOCKDEV - dev_unlock( serial_dev, 0 ); -#endif /* LOCKDEV */ -#endif /* OWUSB */ -#endif /* LINUX */ - exit(EXIT_OK); } @@ -2780,14 +2717,6 @@ fprintf( stderr, "USB ERROR: %s\n", temp ); #endif /* OWUSB */ -#ifdef LINUX -#ifndef OWUSB -#ifdef LOCKDEV - dev_unlock( serial_dev, 0 ); -#endif /* LOCKDEV */ -#endif /* OWUSB */ -#endif /* LINUX */ - exit(EXIT_ERR); } } @@ -2872,14 +2801,6 @@ owRelease(0, temp ); #endif /* OWUSB */ -#ifdef LINUX -#ifndef OWUSB -#ifdef LOCKDEV - dev_unlock( serial_dev, 0 ); -#endif /* LOCKDEV */ -#endif /* OWUSB */ -#endif /* LINUX */ - exit(EXIT_OK); } Index: digitemp-3.6.0+dfsg1/userial/ds9097/linuxses.c =================================================================== --- digitemp-3.6.0+dfsg1.orig/userial/ds9097/linuxses.c 2007-06-07 21:25:58.000000000 +0000 +++ digitemp-3.6.0+dfsg1/userial/ds9097/linuxses.c 2013-11-09 21:21:55.843565700 +0000 @@ -39,6 +39,7 @@ #include #include #include +#include /* local function prototypes */ SMALLINT owAcquire(int,char *); @@ -62,6 +63,14 @@ return FALSE; } + /* Lock the device */ + if(flock(fd[portnum], LOCK_EX|LOCK_NB)) + { + OWERROR(OWERROR_GET_SYSTEM_RESOURCE_FAILED); + perror("owAcquire: failed to open device"); + return FALSE; + } + /* Get device settings */ if(tcgetattr(fd[portnum], &term[portnum] ) < 0 ) { Index: digitemp-3.6.0+dfsg1/userial/ds9097u/linuxlnk.c =================================================================== --- digitemp-3.6.0+dfsg1.orig/userial/ds9097u/linuxlnk.c 2007-06-07 21:25:58.000000000 +0000 +++ digitemp-3.6.0+dfsg1/userial/ds9097u/linuxlnk.c 2013-11-09 21:21:40.195561463 +0000 @@ -93,6 +93,7 @@ #include #include #include +#include #include "ds2480.h" #include "ownet.h" @@ -138,6 +139,14 @@ OWERROR(OWERROR_GET_SYSTEM_RESOURCE_FAILED); return FALSE; // changed (2.00), used to return fd; } + + /* Lock the device */ + if(flock(fd[portnum], LOCK_EX|LOCK_NB)) + { + OWERROR(OWERROR_GET_SYSTEM_RESOURCE_FAILED); + return FALSE; + } + rc = tcgetattr (fd[portnum], &t); if (rc < 0) { debian/patches/digitemp-3.6.0+dfsg1-banner-version.patch0000664000000000000000000000126112060773416020040 0ustar Fix incorrect version number in banner Patch author: Ryan Finnie "3.5.0" is currently hard-coded (and incorrect) --- a/src/digitemp.h +++ b/src/digitemp.h @@ -18,7 +18,7 @@ with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA ----------------------------------------------------------------------- */ -#define BANNER_1 "DigiTemp v3.5.0 Copyright 1996-2007 by Brian C. Lane\n" +#define BANNER_1 "DigiTemp v3.6.0 Copyright 1996-2007 by Brian C. Lane\n" #define BANNER_2 "GNU Public License v2.0 - http://www.digitemp.com\n" #define BANNER_3 "Compiled for %s\n\n" debian/patches/digitemp-3.6.0+dfsg1-code-spelling.patch0000664000000000000000000000617412060773511017641 0ustar Spelling corrections in binary code Patch author: Ryan Finnie This patch corrects misspelled words in binaries, as found by lintian. Note, not all corrections (code comments, etc) were made, just binary visible words. This patch will be forwarded upstream, with a recommendation that all spelling errors be fixed. Currently found: * Initalize -> Initialize * seperated -> separated * arguements -> arguments * GNU Public License -> GNU General Public License --- a/digitemp.1 +++ b/digitemp.1 @@ -104,7 +104,7 @@ 2 = One line per sample, elapsed time, temperature in C 3 = Same as #2, except temperature is in F .PP -#2 and #3 have the data seperated by tabs, suitable for import into a +#2 and #3 have the data separated by tabs, suitable for import into a spreadsheet or other graphing software. .PP The format string uses strftime tokens plus 5 special ones for --- a/src/digitemp.c +++ b/src/digitemp.c @@ -196,8 +196,8 @@ printf(BANNER_2); printf(BANNER_3, dtlib ); /* Report Library version */ printf("\nUsage: digitemp [-s -i -I -U -l -r -v -t -a -d -n -o -c]\n"); - printf(" -i Initalize .digitemprc file\n"); - printf(" -I Initalize .digitemprc file w/sorted serial #s\n"); + printf(" -i Initialize .digitemprc file\n"); + printf(" -I Initialize .digitemprc file w/sorted serial #s\n"); printf(" -w Walk the full device tree\n"); printf(" -s /dev/ttyS0 Set serial port\n"); printf(" -l /var/log/temperature Send output to logfile\n"); @@ -218,7 +218,7 @@ printf("\nLogfile formats: 1 = One line per sensor, time, C, F (default)\n"); printf(" 2 = One line per sample, elapsed time, temperature in C\n"); printf(" 3 = Same as #2, except temperature is in F\n"); - printf(" #2 and #3 have the data seperated by tabs, suitable for import\n"); + printf(" #2 and #3 have the data separated by tabs, suitable for import\n"); printf(" into a spreadsheet or other graphing software.\n"); printf("\n The format string uses strftime tokens plus 5 special ones for\n"); printf(" digitemp - %%s for sensor #, %%C for centigrade, %%F for fahrenheit,\n"); @@ -2432,7 +2432,7 @@ if( argc <= 1 ) { - fprintf(stderr,"Error! Not enough arguements.\n\n"); + fprintf(stderr,"Error! Not enough arguments.\n\n"); usage(); return -1; } --- a/src/digitemp.h +++ b/src/digitemp.h @@ -19,7 +19,7 @@ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA ----------------------------------------------------------------------- */ #define BANNER_1 "DigiTemp v3.6.0 Copyright 1996-2007 by Brian C. Lane\n" -#define BANNER_2 "GNU Public License v2.0 - http://www.digitemp.com\n" +#define BANNER_2 "GNU General Public License v2.0 - http://www.digitemp.com\n" #define BANNER_3 "Compiled for %s\n\n" #define OPT_INIT 0x0001 debian/patches/digitemp-3.6.0+dfsg1-flush-stdout.patch0000664000000000000000000000044512060774244017554 0ustar Flush logs when running non-interactive Patch author: Alexander Inyukhin See http://bugs.debian.org/691069 --- a/src/digitemp.c +++ b/src/digitemp.c @@ -587,6 +587,7 @@ close( fd ); } else { printf( line ); + fflush( stdout ); } return 0; } debian/patches/digitemp-3.6.0+dfsg1-format-security.patch0000664000000000000000000000105212060774406020243 0ustar Correct errors caught by -Werror=format-security Patch author: Ryan Finnie --- a/src/digitemp.c +++ b/src/digitemp.c @@ -586,7 +586,7 @@ perror("Error loging to logfile"); close( fd ); } else { - printf( line ); + printf( "%s",line ); fflush( stdout ); } return 0; --- a/userial/ioutil.c +++ b/userial/ioutil.c @@ -86,7 +86,7 @@ // remember the start length deflen = strlen(buf); if (deflen < 80) - sprintf(defbuf,buf); + sprintf(defbuf,"%s",buf); else defbuf[0] = 0;