<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">Description: Fix code in source
  Fix code that probably is never run since the existing code is totally bogus.
  The condition, !open(...), will almost always be true.  (sole exception is
  when starting a program with stdin initially closed)

Forwarded: no
Author: Jim Meyering &lt;meyering@redhat.com&gt;
Last-Update: Mon, 20 Jul 2009 21:05:44 +0200

--- a/ntreg.c
+++ b/ntreg.c
@@ -4133,7 +4133,7 @@
   if ( !(hdesc-&gt;state &amp; HMODE_DIRTY)) return(0);
 
   if ( !(hdesc-&gt;state &amp; HMODE_OPEN)) { /* File has been closed */
-    if (!(hdesc-&gt;filedesc = open(hdesc-&gt;filename,O_RDWR))) {
+    if ((hdesc-&gt;filedesc = open(hdesc-&gt;filename,O_RDWR)) &lt; 0) {
       fprintf(stderr,"writeHive: open(%s) failed: %s, FILE NOT WRITTEN!\n",hdesc-&gt;filename,strerror(errno));
       return(1);
     }
</pre></body></html>