]> ruderich.org/simon Gitweb - coloredstderr/coloredstderr.git/blobdiff - src/coloredstderr.c
coloredstderr.c: Use #include <config.h>.
[coloredstderr/coloredstderr.git] / src / coloredstderr.c
index 6a10654c7a41ddbd4507de2a9b3aeac67efc55a8..e04a2ea01be40b4d0644ed65a031b93629c6b2b9 100644 (file)
@@ -18,7 +18,7 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#include "config.h"
+#include <config.h>
 
 /* Must be loaded before the following headers. */
 #include "ldpreload.h"
@@ -62,6 +62,9 @@ static int check_handle_fd(int fd) {
     if (!initialized) {
         init_from_environment();
     }
+    if (tracked_fds_count == 0) {
+        return 0;
+    }
 
     /* Never touch anything not going to a terminal - unless we are explicitly
      * asked to do so. */
@@ -69,9 +72,6 @@ static int check_handle_fd(int fd) {
         return 0;
     }
 
-    if (tracked_fds_count == 0) {
-        return 0;
-    }
     return tracked_fds_find(fd);
 }
 
@@ -108,10 +108,10 @@ static void close_fd(int fd) {
     if (!initialized) {
         init_from_environment();
     }
-
     if (tracked_fds_count == 0) {
         return;
     }
+
     tracked_fds_remove(fd);
 }