aboutsummaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
Diffstat (limited to 'common')
-rw-r--r--common/ChangeLog10
-rw-r--r--common/estream.c6
-rw-r--r--common/pka.c4
-rw-r--r--common/signal.c16
-rw-r--r--common/t-exechelp.c11
-rw-r--r--common/t-timestuff.c3
6 files changed, 26 insertions, 24 deletions
diff --git a/common/ChangeLog b/common/ChangeLog
index c56bc4d8f..95aef653c 100644
--- a/common/ChangeLog
+++ b/common/ChangeLog
@@ -1,3 +1,13 @@
+2011-08-10 Werner Koch <[email protected]>
+
+ * t-exechelp.c (test_close_all_fds): Don't use the DUMMY_FD var.
+
+ * pka.c (get_pka_info): Remove unused var.
+
+ * signal.c (got_fatal_signal): Remove unused var.
+
+ * estream.c (es_fread, es_fwrite): Remove unused var.
+
2011-07-20 Werner Koch <[email protected]>
* ssh-utils.c, ssh-utils.h: New.
diff --git a/common/estream.c b/common/estream.c
index 5b5567426..8087a6287 100644
--- a/common/estream.c
+++ b/common/estream.c
@@ -3425,12 +3425,11 @@ es_fread (void *ES__RESTRICT ptr, size_t size, size_t nitems,
estream_t ES__RESTRICT stream)
{
size_t ret, bytes;
- int err;
if (size * nitems)
{
ESTREAM_LOCK (stream);
- err = es_readn (stream, ptr, size * nitems, &bytes);
+ es_readn (stream, ptr, size * nitems, &bytes);
ESTREAM_UNLOCK (stream);
ret = bytes / size;
@@ -3447,12 +3446,11 @@ es_fwrite (const void *ES__RESTRICT ptr, size_t size, size_t nitems,
estream_t ES__RESTRICT stream)
{
size_t ret, bytes;
- int err;
if (size * nitems)
{
ESTREAM_LOCK (stream);
- err = es_writen (stream, ptr, size * nitems, &bytes);
+ es_writen (stream, ptr, size * nitems, &bytes);
ESTREAM_UNLOCK (stream);
ret = bytes / size;
diff --git a/common/pka.c b/common/pka.c
index 7ac70d9c4..89761f5a5 100644
--- a/common/pka.c
+++ b/common/pka.c
@@ -175,7 +175,7 @@ get_pka_info (const char *address, unsigned char *fpr)
#else /*!USE_ADNS*/
unsigned char answer[PACKETSZ];
int anslen;
- int qdcount, ancount, nscount, arcount;
+ int qdcount, ancount;
int rc;
unsigned char *p, *pend;
const char *domain;
@@ -212,8 +212,6 @@ get_pka_info (const char *address, unsigned char *fpr)
qdcount = ntohs (header.qdcount);
ancount = ntohs (header.ancount);
- nscount = ntohs (header.nscount);
- arcount = ntohs (header.arcount);
if (!ancount)
return NULL; /* Got no answer. */
diff --git a/common/signal.c b/common/signal.c
index 9f11b9922..28b2acc2e 100644
--- a/common/signal.c
+++ b/common/signal.c
@@ -89,8 +89,6 @@ get_signal_name( int signum )
static RETSIGTYPE
got_fatal_signal (int sig)
{
- /* Dummy result variable to suppress gcc warning. */
- int res;
const char *s;
if (caught_fatal_sig)
@@ -100,14 +98,14 @@ got_fatal_signal (int sig)
if (cleanup_fnc)
cleanup_fnc ();
/* Better don't translate these messages. */
- res = write (2, "\n", 1 );
+ (void)write (2, "\n", 1 );
s = log_get_prefix (NULL);
if (s)
- res = write(2, s, strlen (s));
- res = write (2, ": signal ", 9 );
+ (void)write(2, s, strlen (s));
+ (void)write (2, ": signal ", 9 );
s = get_signal_name(sig);
if (s)
- res = write (2, s, strlen(s) );
+ (void) write (2, s, strlen(s) );
else
{
/* We are in a signal handler so we can't use any kind of printf
@@ -117,7 +115,7 @@ got_fatal_signal (int sig)
things are messed up because we modify its value. Although
this is a bug in that system, we will protect against it. */
if (sig < 0 || sig >= 100000)
- res = write (2, "?", 1);
+ (void)write (2, "?", 1);
else
{
int i, value, any=0;
@@ -126,7 +124,7 @@ got_fatal_signal (int sig)
{
if (value >= i || ((any || i==1) && !(value/i)))
{
- res = write (2, "0123456789"+(value/i), 1);
+ (void)write (2, "0123456789"+(value/i), 1);
if ((value/i))
any = 1;
value %= i;
@@ -134,7 +132,7 @@ got_fatal_signal (int sig)
}
}
}
- res = write (2, " caught ... exiting\n", 20);
+ (void)write (2, " caught ... exiting\n", 20);
/* Reset action to default action and raise signal again */
init_one_signal (sig, SIG_DFL, 0);
diff --git a/common/t-exechelp.c b/common/t-exechelp.c
index e4c88d126..19079d331 100644
--- a/common/t-exechelp.c
+++ b/common/t-exechelp.c
@@ -76,7 +76,6 @@ test_close_all_fds (void)
int max_fd = get_max_fds ();
int *array;
int fd;
- int dummy_fd;
int initial_count, count, n;
#if 0
char buffer[100];
@@ -93,10 +92,10 @@ test_close_all_fds (void)
free (array);
/* Some dups to get more file descriptors and close one. */
- dummy_fd = dup (1);
- dummy_fd = dup (1);
+ dup (1);
+ dup (1);
fd = dup (1);
- dummy_fd = dup (1);
+ dup (1);
close (fd);
array = xget_all_open_fds ();
@@ -137,14 +136,14 @@ test_close_all_fds (void)
int except[] = { 20, 23, 24, -1 };
for (n=initial_count; n < 31; n++)
- dummy_fd = dup (1);
+ dup (1);
array = xget_all_open_fds ();
if (verbose)
print_open_fds (array);
free (array);
for (n=0; n < 5; n++)
{
- dummy_fd = dup (1);
+ dup (1);
array = xget_all_open_fds ();
if (verbose)
print_open_fds (array);
diff --git a/common/t-timestuff.c b/common/t-timestuff.c
index c9c8fe5b8..8e5fa65ee 100644
--- a/common/t-timestuff.c
+++ b/common/t-timestuff.c
@@ -81,10 +81,9 @@ test_timegm (void)
};
int tidx;
- time_t now, atime, counter;
+ time_t now, atime;
struct tm tbuf, tbuf2, *tp;
- counter = 0;
for (tidx=0; tidx < DIM (tvalues); tidx++)
{
if (tvalues[tidx].year == -1)