aboutsummaryrefslogtreecommitdiff
path: root/gdb/linux-nat.c
diff options
context:
space:
mode:
authorJim Blandy <jimb@codesourcery.com>2009-01-06 18:31:59 +0000
committerJim Blandy <jimb@codesourcery.com>2009-01-06 18:31:59 +0000
commitbf1d7d9ce0e35cfa01400e2da11f0d84ea89e481 (patch)
tree14141ae5495ade474ca69afa2dbe85a60e302989 /gdb/linux-nat.c
parentfdb7262ae487eccebfaf84f3a5cbecbdeae2c5c7 (diff)
downloadgdb-bf1d7d9ce0e35cfa01400e2da11f0d84ea89e481.zip
gdb-bf1d7d9ce0e35cfa01400e2da11f0d84ea89e481.tar.gz
gdb-bf1d7d9ce0e35cfa01400e2da11f0d84ea89e481.tar.bz2
Check return values of functions declared with warn_unused_result
attribute in GLIBC 2.8. * cli/cli-cmds.c (pwd_command): Check return value from getcwd. * inflow.c (check_syscall): New function. (new_tty): Use check_syscall to check return values from open and dup. * linux-nat.c (linux_nat_info_proc_cmd): Check return value from fgets. * main.c (captured_main): Call cwd after setting up gdb_stderr; check for errors from getcwd. * mi/mi-cmd-env.c (mi_cmd_env_pwd): Check return value from getcwd. * ui-file.c (stdio_file_write): Ignore return value from fwrite. (stdio_file_fputs): Same. * utils.c (internal_vproblem): abort if last-ditch error message write fails.
Diffstat (limited to 'gdb/linux-nat.c')
-rw-r--r--gdb/linux-nat.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c
index dfa7ef2..9a7e39c 100644
--- a/gdb/linux-nat.c
+++ b/gdb/linux-nat.c
@@ -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