--- pgp/src/system.c 2018/04/24 16:42:01 1.1.1.6 +++ pgp/src/system.c 2018/04/24 16:44:27 1.1.1.8 @@ -148,7 +148,12 @@ void ttycbreak(void) tio.c_cc[VTIME] = 0; tio.c_lflag &= ~(ECHO|ICANON); #ifndef SVR2 +#ifdef ultrix + /* Ultrix is broken and flushes the output as well! */ + tcsetattr (ttyfd, TCSANOW, &tio); +#else tcsetattr (ttyfd, TCSAFLUSH, &tio); +#endif #else ioctl(ttyfd, TCSETAF, &tio); #endif /* not SVR2 */ @@ -187,7 +192,12 @@ void ttynorm(void) #endif #ifndef NOTERMIO #ifndef SVR2 +#ifdef ultrix + /* Ultrix is broken and flushes the output as well! */ + tcsetattr (ttyfd, TCSANOW, &itio); +#else tcsetattr (ttyfd, TCSAFLUSH, &itio); +#endif #else ioctl(ttyfd, TCSETAF, &itio); #endif /* not SVR2 */ @@ -330,7 +340,8 @@ register int n; } #endif /* _BSD */ -#if (defined(MACH) || defined(SVR2) || defined(_BSD)) && !defined(NEXT) && !defined(AUX) || (defined(sun) && defined(i386)) +#if (defined(MACH) || defined(SVR2) || defined(_BSD)) && !defined(NEXT) \ +&& !defined(AUX) && !defined(__MACHTEN__) || (defined(sun) && defined(i386)) int remove(name) char *name; { @@ -357,7 +368,8 @@ register char *old, *new; long Clock() /* not a replacement for clock(), just for random number generation */ { -#if defined(_BSD) || (defined(sun) && !defined(SOLARIS)) || defined(MACH) || defined(linux) +#if defined(_BSD) || (defined(sun) && !defined(SOLARIS)) || \ +defined(MACH) || defined(linux) #include #include struct rusage ru; @@ -484,7 +496,8 @@ static volatile struct { int ExtChar; } CharBuf, OldCharBuf; -static $DESCRIPTOR (out_file_descr, "SYS$DISK:[]"); /* Default Output File Descr */ +static $DESCRIPTOR (out_file_descr, "SYS$DISK:[]"); /* Default Output + File Descr */ static int flags = FDL$M_FDL_STRING; @@ -832,7 +845,8 @@ void ttycbreak () 0, 0, &buf, - (TypCharBuf.TypAhdCnt >= 80 ? 80 : TypCharBuf.TypAhdCnt), + (TypCharBuf.TypAhdCnt >= 80 ? 80 : + TypCharBuf.TypAhdCnt), 1, &NoTerm, 0, @@ -863,7 +877,8 @@ void ttycbreak () 0, 0)) & 01) sts = iosb.sts; if (!(sts & 01)) { - fprintf(stderr,"\nttybreak()- Failed to set terminal characteristics!"); + fprintf(stderr, + "\nttybreak()- Failed to set terminal characteristics!"); (void) lib$signal(sts); exitPGP(1); } @@ -913,8 +928,8 @@ int vms_GetCmd( char *cmdtbl) */ verb_size = cmdprmt_d.dsc$w_length - 2; /* Loose '> ' characters */ cmdbuf_d.dsc$w_length = MAX_CMDSIZ-verb_size-1; - cmdbuf_d.dsc$a_pointer = strncpy(cmdbuf,cmdprmt_d.dsc$a_pointer,verb_size) + - verb_size+1; + cmdbuf_d.dsc$a_pointer = strncpy(cmdbuf,cmdprmt_d.dsc$a_pointer,verb_size) + + verb_size+1; cmdbuf[verb_size++]=' '; if ((sts = lib$get_foreign ( /* Recover command line from DCL */ &cmdbuf_d, @@ -923,7 +938,8 @@ int vms_GetCmd( char *cmdtbl) 0)) & 01) { cmdbuf_d.dsc$a_pointer = cmdbuf; cmdbuf_d.dsc$w_length = cmdsiz + verb_size; - VAXC$ESTABLISH(lib$sig_to_ret); /* Force unhandled exceptions to return */ + VAXC$ESTABLISH(lib$sig_to_ret); /* Force unhandled exceptions + to return */ sts = cli$dcl_parse( /* Parse Command Line */ &cmdbuf_d, cmdtbl, @@ -965,7 +981,8 @@ vms_TstOpt(char opt) struct dsc$descriptor option_d = { 1, 0, 0, &buf}; buf = _toupper(opt); - VAXC$ESTABLISH(lib$sig_to_ret); /* Force unhandled exceptions to return */ + VAXC$ESTABLISH(lib$sig_to_ret); /* Force unhandled exceptions + to return */ switch (sts=cli$present(&option_d)) { @@ -1010,7 +1027,8 @@ vms_GetVal( char opt, char *resval, unsi struct dsc$descriptor value_d = {maxsiz-1, 0, 0, resval }; unsigned short valsiz; - VAXC$ESTABLISH(lib$sig_to_ret); /* Force unhandled exceptions to return */ + VAXC$ESTABLISH(lib$sig_to_ret); /* Force unhandled exceptions + to return */ buf = _toupper(opt); if ((sts = cli$get_value( &option_d, @@ -1049,7 +1067,8 @@ vms_GetArg( unsigned short arg, char *re struct dsc$descriptor value_d = {maxsiz-1, 0, 0, resval }; unsigned short valsiz; - VAXC$ESTABLISH(lib$sig_to_ret); /* Force unhandled exceptions to return */ + VAXC$ESTABLISH(lib$sig_to_ret); /* Force unhandled exceptions + to return */ buf[1] = arg + '0'; if ((sts = cli$present(&option_d)) & 01) { if ((sts = cli$get_value( @@ -1092,7 +1111,8 @@ do_help(char *helptext, char *helplib) struct dsc$descriptor helptext_d = { strlen(helptext), 0, 0, helptext}; struct dsc$descriptor helplib_d = { strlen(helplib), 0, 0, helplib}; - VAXC$ESTABLISH(lib$sig_to_ret); /* Force unhandled exceptions to return */ + VAXC$ESTABLISH(lib$sig_to_ret); /* Force unhandled + exceptions to return */ if (((sts = kbhit_Getchn()) & 01) || sts == 0) { helpflags = HLP$M_PROMPT|HLP$M_SYSTEM|HLP$M_GROUP|HLP$M_PROCESS; sts = lbr$output_help( @@ -1201,7 +1221,8 @@ int fdl_generate(char *in_file, char **f &badblk, len)) & 01)) { if (verbose) - fprintf(stderr,"\n(SYSTEM) Failed to generate FDL\n",in_file); + fprintf(stderr,"\n(SYSTEM) Failed to generate FDL\n", + in_file); free(fdl); } else { if (!(*fdl = malloc(*len))) return(0); @@ -1339,7 +1360,8 @@ VOID * fdl_create( char *fdl, short len, fdl_close(rab); } else sts = rab; } - fab->fab$l_nam = 0; /* I allocated NAM block, so I must deallocate it! */ + fab->fab$l_nam = 0; /* I allocated NAM block, + so I must deallocate it! */ } free(resnam); return(sts); @@ -1386,15 +1408,16 @@ int fdl_copyfile2bin( FILE *f, VOID *rab count = fread(textbuf,1,count,f); if (count > 0) { /* - * No byte order conversion required, source and target system are both VMS so have - * the same byte ordering. + * No byte order conversion required, source and target system are both + * VMS so have the same byte ordering. */ ((struct RAB *) rab)->rab$w_rsz = (unsigned short) count; if (!(sys$write ( rab, NULL, NULL) & 01)) { - lib$signal(((struct RAB *) rab)->rab$l_sts,((struct RAB *) rab)->rab$l_stv); + lib$signal(((struct RAB *) rab)->rab$l_sts, + ((struct RAB *) rab)->rab$l_stv); status = 1; break; }