From: Bruno Haible Date: Tue, 29 Dec 2020 02:05:25 +0000 (+0100) Subject: ptsname_r: Fix a compiler warning on Solaris. X-Git-Tag: v1.0~3276 X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=8add0168e2bc3158b830aa00a0b0a03d3d27ffa9;p=gnulib.git ptsname_r: Fix a compiler warning on Solaris. * lib/ptsname_r.c (__ptsname_r): Reduce the scope of variable 'err'. --- diff --git a/ChangeLog b/ChangeLog index 29184d2b6b..53be43408b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2020-12-28 Bruno Haible + + ptsname_r: Fix a compiler warning on Solaris. + * lib/ptsname_r.c (__ptsname_r): Reduce the scope of variable 'err'. + 2020-12-28 Bruno Haible gnulib-tool: Fix logic whether to add a dummy.c. diff --git a/lib/ptsname_r.c b/lib/ptsname_r.c index 99d1701dc7..0008b95304 100644 --- a/lib/ptsname_r.c +++ b/lib/ptsname_r.c @@ -86,7 +86,6 @@ __ptsname_r (int fd, char *buf, size_t buflen) return errno; #else int save_errno = errno; - int err; struct stat st; if (buf == NULL) @@ -187,7 +186,7 @@ __ptsname_r (int fd, char *buf, size_t buflen) return ERANGE; } - err = __ttyname_r (fd, buf, buflen); + int err = __ttyname_r (fd, buf, buflen); if (err != 0) { __set_errno (err);