Check return values of functions declared with warn_unused_result
[deliverable/binutils-gdb.git] / gdb / linux-nat.c
index dfa7ef275b243ce08b0c9ec09d1ebcb4c236e8c5..9a7e39c3dc6048c501b4ae249a29eaa701a4d6e9 100644 (file)
@@ -3684,8 +3684,10 @@ linux_nat_info_proc_cmd (char *args, int from_tty)
       if ((procfile = fopen (fname1, "r")) != NULL)
        {
          struct cleanup *cleanup = make_cleanup_fclose (procfile);
-         fgets (buffer, sizeof (buffer), procfile);
-         printf_filtered ("cmdline = '%s'\n", buffer);
+          if (fgets (buffer, sizeof (buffer), procfile))
+            printf_filtered ("cmdline = '%s'\n", buffer);
+          else
+            warning (_("unable to read '%s'"), fname1);
          do_cleanups (cleanup);
        }
       else
This page took 0.025411 seconds and 4 git commands to generate.