]> granicus.if.org Git - fcron/commitdiff
fixed minor bug in fcronsighup: no need to close() after fclose() on stream from...
authorThibault Godouet <fcron@free.fr>
Sun, 13 Apr 2014 17:48:17 +0000 (18:48 +0100)
committerThibault Godouet <fcron@free.fr>
Sun, 13 Apr 2014 17:48:17 +0000 (18:48 +0100)
doc/en/changes.sgml
fcronsighup.c
fcrontab.c

index a2f8b5e13c61f7e0114a1d40a7294c1fb98177a5..8750ddb5ac12e38c6deb1548e34753bc4f862e1a 100644 (file)
@@ -23,6 +23,9 @@ A copy of the license is included in gfdl.sgml.
            <listitem>
               <para>fcrondyn -x no longer adds null characters at the end of the output.  This would cause problems if the output was piped to something as grep.  Thanks Dimitri Semitsoglou-Tsiapos for pointing this out.</para>
            </listitem>
+           <listitem>
+              <para>Fixed minor bug in fcronsighup resulting in log errors about closing the signal file</para>
+           </listitem>
       </itemizedlist>
 
       <itemizedlist>
index 90bd86a478ce37de42d5c3c8b3b1f774c567df4f..c4f248d314ee1f6cf02add5e03282da5e5f86793 100644 (file)
@@ -169,8 +169,10 @@ sig_daemon(void)
 
         sleep(sl);
 
+        /* also closes the underlying file descriptor fd: */
         xfclose_check(&fp, sigfile);
-        xclose_check(&fd, sigfile);
+        /* also reset fd, now closed by xfclose_check(), to make it clear it is closed */
+        fd = -1;
 
         if (remove(sigfile) < 0)
             error_e("Could not remove %s");
index 8f6846260de91a9985063bdffdc3110f216fe027..2e29c3d7e0c43524a7f6cffa539228f04e5f0501 100644 (file)
@@ -402,6 +402,7 @@ list_file(const char *file)
     while ((c = getc(f)) != EOF)
         putchar(c);
 
+    /* also closes the underlying file descriptor fd: */
     xfclose_check(&f, file);
 
 }