From: Jean-Philippe Orsini Date: Tue, 3 Jun 2014 06:54:34 +0000 (+0200) Subject: Imported Upstream version 1.0.2 X-Git-Tag: upstream/1.0.2^0 X-Git-Url: http://wpitchoune.net/gitweb/?p=psensor-pkg-debian.git;a=commitdiff_plain;h=ec32d69fa628fd396e89cf7d57432d509f28c5ae Imported Upstream version 1.0.2 --- diff --git a/NEWS b/NEWS index 6b32544..ecda156 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,12 @@ Psensor NEWS ============ +v1.0.2 +------ + +* +psensor-server+: + - Fixed file descriptor leaks. + v1.0.1 ------ diff --git a/NEWS.html b/NEWS.html index 7714441..ccf68c4 100644 --- a/NEWS.html +++ b/NEWS.html @@ -381,6 +381,25 @@ asciidoc.install();
+

v1.0.2

+
+
    +
  • +

    +psensor-server: +

    +
      +
    • +

      +Fixed file descriptor leaks. +

      +
    • +
    +
  • +
+
+
+

v1.0.1

    @@ -2601,7 +2620,7 @@ Fixed BR1: crash when no temperature sensor is available

    diff --git a/configure b/configure index e5d44ca..fddfe7a 100755 --- a/configure +++ b/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for psensor 1.0.1. +# Generated by GNU Autoconf 2.69 for psensor 1.0.2. # # Report bugs to . # @@ -580,8 +580,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='psensor' PACKAGE_TARNAME='psensor' -PACKAGE_VERSION='1.0.1' -PACKAGE_STRING='psensor 1.0.1' +PACKAGE_VERSION='1.0.2' +PACKAGE_STRING='psensor 1.0.2' PACKAGE_BUGREPORT='jeanfi@gmail.com' PACKAGE_URL='http://wpitchoune.net/psensor' @@ -1402,7 +1402,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures psensor 1.0.1 to adapt to many kinds of systems. +\`configure' configures psensor 1.0.2 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1476,7 +1476,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of psensor 1.0.1:";; + short | recursive ) echo "Configuration of psensor 1.0.2:";; esac cat <<\_ACEOF @@ -1625,7 +1625,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -psensor configure 1.0.1 +psensor configure 1.0.2 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2048,7 +2048,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by psensor $as_me 1.0.1, which was +It was created by psensor $as_me 1.0.2, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2865,7 +2865,7 @@ fi # Define the identity of the package. PACKAGE='psensor' - VERSION='1.0.1' + VERSION='1.0.2' cat >>confdefs.h <<_ACEOF @@ -9949,7 +9949,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by psensor $as_me 1.0.1, which was +This file was extended by psensor $as_me 1.0.2, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -10016,7 +10016,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -psensor config.status 1.0.1 +psensor config.status 1.0.2 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff --git a/configure.ac b/configure.ac index e37c81e..0a2630a 100644 --- a/configure.ac +++ b/configure.ac @@ -2,7 +2,7 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ([2.69]) -AC_INIT([psensor], [1.0.1],[jeanfi@gmail.com],[psensor],[http://wpitchoune.net/psensor]) +AC_INIT([psensor], [1.0.2],[jeanfi@gmail.com],[psensor],[http://wpitchoune.net/psensor]) AM_INIT_AUTOMAKE([-Wall gnu]) diff --git a/src/lib/pio.c b/src/lib/pio.c index 4a1a6ce..f6ebc73 100644 --- a/src/lib/pio.c +++ b/src/lib/pio.c @@ -168,11 +168,11 @@ char *file_get_content(const char *fpath) page = malloc(size + 1); if (!page || size != fread(page, 1, size, fp)) { free(page); - return NULL; + page = NULL; + } else { + *(page + size) = '\0'; } - *(page + size) = '\0'; - fclose(fp); } else { page = NULL; @@ -185,25 +185,24 @@ char *file_get_content(const char *fpath) long file_get_size(const char *path) { FILE *fp; + long size; if (!is_file(path)) return -1; fp = fopen(path, "rb"); if (fp) { - long size; - if (fseek(fp, 0, SEEK_END) == -1) - return -1; - - size = ftell(fp); + size = -1; + else + size = ftell(fp); fclose(fp); - - return size; + } else { + size = -1; } - return -1; + return size; } #define FCOPY_BUF_SZ 4096 diff --git a/src/psensor.1 b/src/psensor.1 index 696b918..04a2eb6 100644 --- a/src/psensor.1 +++ b/src/psensor.1 @@ -1,5 +1,5 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.44.1. -.TH PSENSOR "1" "June 2014" "psensor 1.0.1" "User Commands" +.TH PSENSOR "1" "June 2014" "psensor 1.0.2" "User Commands" .SH NAME psensor \- Temperature monitoring application .SH SYNOPSIS diff --git a/src/server/psensor-server.1 b/src/server/psensor-server.1 index b2f6593..8628bce 100644 --- a/src/server/psensor-server.1 +++ b/src/server/psensor-server.1 @@ -1,5 +1,5 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.44.1. -.TH PSENSOR-SERVER "1" "June 2014" "psensor-server 1.0.1" "User Commands" +.TH PSENSOR-SERVER "1" "June 2014" "psensor-server 1.0.2" "User Commands" .SH NAME psensor-server \- Temperature and system monitoring Web server .SH SYNOPSIS