aboutsummaryrefslogtreecommitdiff
path: root/readline/util.c
diff options
context:
space:
mode:
authorAlan Hayward <alan.hayward@arm.com>2019-01-31 09:48:39 +0000
committerAlan Hayward <alan.hayward@arm.com>2019-01-31 17:25:06 +0000
commit16bfc2f9705b40a11052f465b83fea2ec0904ce5 (patch)
tree8638920c33139a191a40b3b7f36b4cb7454ff8d1 /readline/util.c
parentfc60b8c806a641cc2260c8b26f389f2abdc99dda (diff)
downloadgdb-16bfc2f9705b40a11052f465b83fea2ec0904ce5.zip
gdb-16bfc2f9705b40a11052f465b83fea2ec0904ce5.tar.gz
gdb-16bfc2f9705b40a11052f465b83fea2ec0904ce5.tar.bz2
Readline: Cleanup some warnings
Cleanup the readline warnings that gdb buildbot complains about. To prevent wcwidth missing declaration warnings, add the SOURCE / EXTENSION macros to config.in that have already checked for in configure. Ensure pid is a long before printing as one. Also fix GNU style. Check the return value of write the same way as history_do_write (). These changes are consistent with upstream readline. readline/ChangeLog.gdb: * config.h.in: Add SOURCE/EXTENSION macros. * histfile.c (history_truncate_file): Check return of write. * util.c (_rl_tropen): Ensure pid is long.
Diffstat (limited to 'readline/util.c')
-rw-r--r--readline/util.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/readline/util.c b/readline/util.c
index d402fce..13bd00c 100644
--- a/readline/util.c
+++ b/readline/util.c
@@ -515,11 +515,11 @@ _rl_tropen ()
(sh_get_env_value ("TEMP")
? sh_get_env_value ("TEMP")
: "."),
- getpid());
+ getpid ());
#else
- sprintf (fnbuf, "/var/tmp/rltrace.%ld", getpid());
+ sprintf (fnbuf, "/var/tmp/rltrace.%ld", (long) getpid ());
#endif
- unlink(fnbuf);
+ unlink (fnbuf);
_rl_tracefp = fopen (fnbuf, "w+");
return _rl_tracefp != 0;
}