fts.c
changeset 112 9bfb339a8156
parent 77 49e0babccb23
--- a/fts.c
+++ b/fts.c
@@ -43,8 +43,9 @@
     }
 
     paths[i] = NULL;
+    errno = 0;
 
-    if ((fts = fts_open (paths, FTS_NOSTAT, &compare)) == NULL) {
+    if ((fts = fts_open (paths, FTS_NOSTAT, (void *)&compare)) == NULL) {
         perror ("fts_open");
         return EXIT_FAILURE;
     }
@@ -52,6 +53,8 @@
     while ((current = fts_read (fts)) != NULL) {
         if (!errno)
             printf ("%s/%s\n", current->fts_path, current->fts_name);
+        else
+            perror ("fts_read");
     }
 
     if (fts_close (fts) < 0)