diff --git a/src/main.c b/src/main.c
index 3376fa4..eadedc9 100644
--- a/src/main.c
+++ b/src/main.c
@@ -1249,9 +1249,10 @@ grepfile (char const *file, struct stats *stats)
                                       || S_ISSOCK (stats->stat.st_mode)
                                       || S_ISFIFO (stats->stat.st_mode))))
     {
-      if (file)
+      if (file) {
         close (desc);
-      return 1;
+        return 1;
+      }
     }
 
   /* If there is a regular file on stdout and the current file refers
