Whamcloud - gitweb
b=19720
[fs/lustre-release.git] / lustre / utils / obd.c
index a912496..4542228 100644 (file)
@@ -953,7 +953,12 @@ try_mdc:
                 goto fail;
 
 got_one:
-        fgets(buf, sizeof(buf), fp);
+        /* should not ignore fgets(3)'s return value */
+        if (!fgets(buf, sizeof(buf), fp)) {
+                fprintf(stderr, "reading from %s: %s", buf, strerror(errno));
+                fclose(fp);
+                return;
+        }
         fclose(fp);
 
         /* trim trailing newlines */