aboutsummaryrefslogtreecommitdiffstats
path: root/vms/vms_popen.c
diff options
context:
space:
mode:
Diffstat (limited to 'vms/vms_popen.c')
-rw-r--r--vms/vms_popen.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/vms/vms_popen.c b/vms/vms_popen.c
index 62f3f719..d9568119 100644
--- a/vms/vms_popen.c
+++ b/vms/vms_popen.c
@@ -133,8 +133,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 +172,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 +219,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 +333,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.