diff options
author | Jim Blandy <jimb@codesourcery.com> | 2009-01-06 18:31:58 +0000 |
---|---|---|
committer | Jim Blandy <jimb@codesourcery.com> | 2009-01-06 18:31:58 +0000 |
commit | 3bdc07d2a6f44070a5ef57b305a2e4c816b0a820 (patch) | |
tree | faa165907390d42b9c1e5511f52580d111839444 /gdb/cli | |
parent | 0bd695e5a4e79c240a67ea794cb83a7324584a8d (diff) | |
download | gdb-3bdc07d2a6f44070a5ef57b305a2e4c816b0a820.tar.gz |
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/cli')
-rw-r--r-- | gdb/cli/cli-cmds.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/gdb/cli/cli-cmds.c b/gdb/cli/cli-cmds.c index de35e1a3b05..b391e303ca9 100644 --- a/gdb/cli/cli-cmds.c +++ b/gdb/cli/cli-cmds.c @@ -320,7 +320,9 @@ pwd_command (char *args, int from_tty) { if (args) error (_("The \"pwd\" command does not take an argument: %s"), args); - getcwd (gdb_dirbuf, sizeof (gdb_dirbuf)); + if (! getcwd (gdb_dirbuf, sizeof (gdb_dirbuf))) + error (_("Error finding name of working directory: %s"), + safe_strerror (errno)); if (strcmp (gdb_dirbuf, current_directory) != 0) printf_unfiltered (_("Working directory %s\n (canonically %s).\n"), |