From 9179e1d2f73c1afb36cdc0b43163f8176b97e6f6 Mon Sep 17 00:00:00 2001 From: Johan Danielsson Date: Tue, 21 Sep 2004 11:32:54 +0000 Subject: [PATCH] (init_ivecs): if we don't have an errsock the ivecs should point to the same data git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@14235 ec53bebd-3082-4978-b11e-865c3cabbd6b --- appl/rsh/common.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/appl/rsh/common.c b/appl/rsh/common.c index c0d151ca6..75cc32063 100644 --- a/appl/rsh/common.c +++ b/appl/rsh/common.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997 - 1999, 2002 Kungliga Tekniska Högskolan + * Copyright (c) 1997-2004 Kungliga Tekniska Högskolan * (Royal Institute of Technology, Stockholm, Sweden). * All rights reserved. * @@ -43,7 +43,7 @@ void *ivec_in[2]; void *ivec_out[2]; void -init_ivecs(int client) +init_ivecs(int client, int have_errsock) { size_t blocksize; @@ -52,14 +52,20 @@ init_ivecs(int client) ivec_in[0] = malloc(blocksize); memset(ivec_in[0], client, blocksize); - ivec_in[1] = malloc(blocksize); - memset(ivec_in[1], 2 | client, blocksize); + if(have_errsock) { + ivec_in[1] = malloc(blocksize); + memset(ivec_in[1], 2 | client, blocksize); + } else + ivec_in[1] = ivec_in[0]; ivec_out[0] = malloc(blocksize); memset(ivec_out[0], !client, blocksize); - ivec_out[1] = malloc(blocksize); - memset(ivec_out[1], 2 | !client, blocksize); + if(have_errsock) { + ivec_out[1] = malloc(blocksize); + memset(ivec_out[1], 2 | !client, blocksize); + } else + ivec_out[1] = ivec_out[0]; } #endif