Imported Upstream version 1.0.2 upstream/1.0.2
authorJean-Philippe Orsini <jeanfi@gmail.com>
Tue, 3 Jun 2014 06:54:34 +0000 (08:54 +0200)
committerJean-Philippe Orsini <jeanfi@gmail.com>
Tue, 3 Jun 2014 06:54:34 +0000 (08:54 +0200)
NEWS
NEWS.html
configure
configure.ac
src/lib/pio.c
src/psensor.1
src/server/psensor-server.1

diff --git a/NEWS b/NEWS
index 6b32544..ecda156 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,6 +1,12 @@
 Psensor NEWS
 ============
 
+v1.0.2
+------
+
+* +psensor-server+:
+  - Fixed file descriptor leaks.
+
 v1.0.1
 ------
 
index 7714441..ccf68c4 100644 (file)
--- a/NEWS.html
+++ b/NEWS.html
@@ -381,6 +381,25 @@ asciidoc.install();
 </div>\r
 <div id="content">\r
 <div class="sect1">\r
+<h2 id="_v1_0_2">v1.0.2</h2>\r
+<div class="sectionbody">\r
+<div class="ulist"><ul>\r
+<li>\r
+<p>\r
+<code>psensor-server</code>:\r
+</p>\r
+<div class="ulist"><ul>\r
+<li>\r
+<p>\r
+Fixed file descriptor leaks.\r
+</p>\r
+</li>\r
+</ul></div>\r
+</li>\r
+</ul></div>\r
+</div>\r
+</div>\r
+<div class="sect1">\r
 <h2 id="_v1_0_1">v1.0.1</h2>\r
 <div class="sectionbody">\r
 <div class="ulist"><ul>\r
@@ -2601,7 +2620,7 @@ Fixed BR1: crash when no temperature sensor is available
 <div id="footnotes"><hr /></div>\r
 <div id="footer">\r
 <div id="footer-text">\r
-Last updated 2014-06-02 10:11:58 CEST\r
+Last updated 2014-06-03 08:22:21 CEST\r
 </div>\r
 </div>\r
 </body>\r
index e5d44ca..fddfe7a 100755 (executable)
--- 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 <jeanfi@gmail.com>.
 #
@@ -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\\"
 
index e37c81e..0a2630a 100644 (file)
@@ -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])
 
index 4a1a6ce..f6ebc73 100644 (file)
@@ -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
index 696b918..04a2eb6 100644 (file)
@@ -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
index b2f6593..8628bce 100644 (file)
@@ -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