[gjs] test-coverage: Fix recursive deleting of temporary test data



commit 2061392b1393914a7e1c68b3a676aceb0346586c
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Mon Feb 3 16:11:42 2014 -0500

    test-coverage: Fix recursive deleting of temporary test data
    
    typeflag here is a value integer, not a bitmask, and in this case
    FTW_F is 0, so this test will never produce anything useful...

 test/gjs-test-coverage.cpp |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)
---
diff --git a/test/gjs-test-coverage.cpp b/test/gjs-test-coverage.cpp
index 30a0726..c38b0e7 100644
--- a/test/gjs-test-coverage.cpp
+++ b/test/gjs-test-coverage.cpp
@@ -64,18 +64,16 @@ write_to_file_at_beginning(int        handle,
 static int
 unlink_if_node_is_a_file(const char *path, const struct stat *sb, int typeflag)
 {
-    if (typeflag & FTW_F)
+    if (typeflag == FTW_F)
         unlink(path);
-
     return 0;
 }
 
 static int
 rmdir_if_node_is_a_dir(const char *path, const struct stat *sb, int typeflag)
 {
-    if (typeflag & FTW_D)
+    if (typeflag == FTW_D)
         rmdir(path);
-
     return 0;
 }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]