diff options
Diffstat (limited to 'vms/vms_popen.c')
-rw-r--r-- | vms/vms_popen.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/vms/vms_popen.c b/vms/vms_popen.c index 62f3f719..23482df1 100644 --- a/vms/vms_popen.c +++ b/vms/vms_popen.c @@ -1,6 +1,7 @@ /* [.vms]vms_popen.c -- substitute routines for missing pipe calls. - Copyright (C) 1991-1993, 1996, 2010, 2011 the Free Software Foundation, Inc. + Copyright (C) 1991-1993, 1996, 2010, 2011, 2014 + the Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -133,8 +134,8 @@ pclose( FILE *current ) int rval, cur = fileno(current); /* assert( cur >= 0 && cur < pipes_lim ); */ - if (pipes[cur].pmode == unopened) - return -1; /* should never happen */ + if ((cur < 0) || (pipes[cur].pmode == unopened)) + return -1; /* should never happen, but does with two-way */ rval = fclose(current); /* close temp file; if reading, we're done */ if (pipes[cur].pmode == writing) { @@ -172,7 +173,7 @@ vms_execute( const char *command, const char *input, const char *output ) out_p = 0; push_logicals(); /* guard against user-mode definitions of sys$Xput */ - sts = lib$spawn(&cmd, in_p, out_p, (U_Long *)0, + sts = LIB$SPAWN(&cmd, in_p, out_p, (U_Long *)0, (Dsc *)0, (U_Long *)0, &cmpltn_sts); pop_logicals(); /* restore environment */ @@ -219,9 +220,9 @@ static const Descrip(sys_output,"SYS$OUTPUT"); static const unsigned char acmode = PSL$C_USER; /* only care about user-mode */ /* macros for simplfying the code a bunch */ -#define DelTrans(l) sys$dellnm(&lnmtable, (l), &acmode) -#define GetTrans(l,i) sys$trnlnm((U_Long *)0, &lnmtable, (l), &acmode, (i)) -#define SetTrans(l,i) sys$crelnm((U_Long *)0, &lnmtable, (l), &acmode, (i)) +#define DelTrans(l) SYS$DELLNM(&lnmtable, (l), &acmode) +#define GetTrans(l,i) SYS$TRNLNM((U_Long *)0, &lnmtable, (l), &acmode, (i)) +#define SetTrans(l,i) SYS$CRELNM((U_Long *)0, &lnmtable, (l), &acmode, (i)) /* itemlist manipulation macros; separate versions for aggregate and scalar */ #define SetItmA(i,c,p,r) ((i).code = (c), (i).len = sizeof (p),\ (i).buffer = (p), (i).retlen = (U_Short *)(r)) @@ -333,7 +334,7 @@ restore_translation( const Dsc *logname, const Itm *itemlist ) /* assert( itemlist[2].code == LNM$_STRING ); */ trans_val.adr = itemlist[2].buffer; trans_val.len = itemlist[2].len; - (void) sys$crelog(LOG_PROCESS_TABLE, logname, &trans_val, LOG_USERMODE); + (void) SYS$CRELOG(LOG_PROCESS_TABLE, logname, &trans_val, LOG_USERMODE); } else { /* $crelnm definition; itemlist could specify multiple translations, but has already been setup properly for use as-is. |