summaryrefslogtreecommitdiff
path: root/inet/rexec.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2000-05-29 18:04:55 +0000
committerUlrich Drepper <drepper@redhat.com>2000-05-29 18:04:55 +0000
commit3846463e0784dc1315ed07fcc9a604e12012b051 (patch)
treeacff1b6e670be6957c41eeb56be9862f8495e949 /inet/rexec.c
parent41b5aaf9c93b45455c51666b6c273d2ae56008a3 (diff)
Update.
2000-05-29 Ulrich Drepper <drepper@redhat.com> * inet/Makefile (CFLAGS-rcmd.c, CFLAGS-rexec.c, CFLAGS-ruserpass.c): Removed. * inet/rcmd.c: Remove __P. Remove unused variables. (iruserfopen): Make first parameter const. (ruserok_sa): Return result of ruserok2_sa. (__checkhost_sa): Correctly iterate through results of getaddrinfo. * inet/rexec.c: Remove unused variables. Other small cleanups. * inet/ruserpass.c: Remove __P. Remove unused variables. (ruserpass): Check results of memory allocation. * include/netdb.h: Add prototype for ruserpass.
Diffstat (limited to 'inet/rexec.c')
-rw-r--r--inet/rexec.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/inet/rexec.c b/inet/rexec.c
index 8a977c6ab9..decee94e6d 100644
--- a/inet/rexec.c
+++ b/inet/rexec.c
@@ -40,6 +40,7 @@ static char sccsid[] = "@(#)rexec.c 8.1 (Berkeley) 6/4/93";
#include <stdio.h>
#include <netdb.h>
#include <errno.h>
+#include <stdlib.h>
#include <string.h>
#include <unistd.h>
@@ -58,11 +59,10 @@ rexec_af(ahost, rport, name, pass, cmd, fd2p, af)
struct addrinfo hints, *res0;
const char *orig_name = name;
const char *orig_pass = pass;
- u_short port;
+ u_short port = 0;
int s, timo = 1, s3;
char c;
- int herr;
- int gai, ok;
+ int gai;
char servbuff[NI_MAXSERV];
snprintf(servbuff, sizeof(servbuff), "%d", rport);
@@ -72,7 +72,8 @@ rexec_af(ahost, rport, name, pass, cmd, fd2p, af)
hints.ai_family = af;
hints.ai_socktype = SOCK_STREAM;
hints.ai_flags = AI_CANONNAME;
- if (gai = getaddrinfo(*ahost, servbuff, &hints, &res0)){
+ gai = getaddrinfo(*ahost, servbuff, &hints, &res0);
+ if (gai){
/* XXX: set errno? */
return -1;
}
@@ -148,9 +149,9 @@ retry:
/* We don't need the memory allocated for the name and the password
in ruserpass anymore. */
if (name != orig_name)
- free (name);
+ free ((char *) name);
if (pass != orig_pass)
- free (pass);
+ free ((char *) pass);
if (__read(s, &c, 1) != 1) {
perror(*ahost);