SCCS-vsn: usr.bin/pascal/src/main.c 8.2
SCCS-vsn: usr.bin/pascal/src/yymain.c 8.2
SCCS-vsn: usr.bin/pascal/src/put.c 8.2
SCCS-vsn: usr.bin/pascal/src/savenl.c 8.2
#endif /* not lint */
#ifndef lint
#endif /* not lint */
#ifndef lint
-static char sccsid[] = "@(#)main.c 8.1 (Berkeley) %G%";
+static char sccsid[] = "@(#)main.c 8.2 (Berkeley) %G%";
#endif /* not lint */
#include "whoami.h"
#endif /* not lint */
#include "whoami.h"
register c;
FILE *fopen();
extern char *myctime();
register c;
FILE *fopen();
extern char *myctime();
int i;
if (argv[0][0] == 'a')
int i;
if (argv[0][0] == 'a')
- (void) lseek(efil, (long) seekpt, 0);
+ if (lseek(efil, (off_t) seekpt, 0) == -1)
+ perror(err_file), pexit(DIED);
if (read(efil, buf, 256) <= 0)
perror(err_file), pexit(DIED);
}
if (read(efil, buf, 256) <= 0)
perror(err_file), pexit(DIED);
}
-static char sccsid[] = "@(#)put.c 8.1 (Berkeley) %G%";
+static char sccsid[] = "@(#)put.c 8.2 (Berkeley) %G%";
#endif /* not lint */
#include "whoami.h"
#endif /* not lint */
#include "whoami.h"
short val;
if ( !CGENNING )
short val;
if ( !CGENNING )
if (i >= 0 && i < 1024) {
obuf[i] = val;
} else {
if (i >= 0 && i < 1024) {
obuf[i] = val;
} else {
- (void) lseek(ofil, (long) loc+2, 0);
- write(ofil, (char *) (&val), 2);
- (void) lseek(ofil, (long) 0, 2);
+ if (lseek(ofil, (off_t) loc+2, 0) == -1)
+ perror("patchfil: lseek1"), panic("patchfil");
+ if (write(ofil, (char *) (&val), 2) != 2)
+ perror("patchfil: write"), panic("patchfil");
+ if (lseek(ofil, (off_t) 0, 2) == -1)
+ perror("patchfil: lseek2"), panic("patchfil");
}
loc += 2;
# ifdef DEC11
}
loc += 2;
# ifdef DEC11
-static char sccsid[] = "@(#)savenl.c 8.1 (Berkeley) %G%";
+static char sccsid[] = "@(#)savenl.c 8.2 (Berkeley) %G%";
copynlfile()
{
register int n;
copynlfile()
{
register int n;
int symfd, strfd, filesfd, linesfd;
char buff[BUFSIZ];
int symfd, strfd, filesfd, linesfd;
char buff[BUFSIZ];
fprintf(stderr, "sync error on /tmp/obj");
pexit(ERRS);
}
fprintf(stderr, "sync error on /tmp/obj");
pexit(ERRS);
}
- (void) lseek(ofil, 0L, 2);
+ if (lseek(ofil, (off_t)0, 2) == -1)
+ perror("copynlfile: lseek"), panic("copynlfile");
write(ofil, (char *) (&nlhdr), sizeof(nlhdr));
n = read(strfd, buff, BUFSIZ - sizeof(nlhdr));
write(ofil, buff, n);
write(ofil, (char *) (&nlhdr), sizeof(nlhdr));
n = read(strfd, buff, BUFSIZ - sizeof(nlhdr));
write(ofil, buff, n);
-static char sccsid[] = "@(#)yymain.c 8.1 (Berkeley) %G%";
+static char sccsid[] = "@(#)yymain.c 8.2 (Berkeley) %G%";
#endif /* not lint */
#include "whoami.h"
#endif /* not lint */
#include "whoami.h"
perror(firstname);
pexit(ERRS);
}
perror(firstname);
pexit(ERRS);
}
- (void) lseek(fout[0], 0l, 0);
+ if (lseek(fout[0], (off_t)0, 0) == -1)
+ perror("copyfile: lseek"), panic("copyfile");
while ((c = read(fout[0], &fout[3], 512)) > 0) {
if (write(1, &fout[3], c) != c) {
perror(firstname);
while ((c = read(fout[0], &fout[3], 512)) > 0) {
if (write(1, &fout[3], c) != c) {
perror(firstname);
magic2()
{
struct pxhdr pxhd;
magic2()
{
struct pxhdr pxhd;
if (magichdr.a_magic != 0407)
panic ( "magic2" );
if (magichdr.a_magic != 0407)
panic ( "magic2" );
magichdr.a_data += pxhd.symtabsize;
(void) time((long *) (&pxhd.maketime));
pxhd.magicnum = MAGICNUM;
magichdr.a_data += pxhd.symtabsize;
(void) time((long *) (&pxhd.maketime));
pxhd.magicnum = MAGICNUM;
- (void) lseek(ofil, 0l, 0);
+ if (lseek(ofil, (off_t)0, 0) == -1)
+ perror("magic2: lseek1"), panic("magic2");
write(ofil, (char *) (&magichdr), sizeof(struct exec));
write(ofil, (char *) (&magichdr), sizeof(struct exec));
- (void) lseek(ofil, ( long ) ( HEADER_BYTES - sizeof ( pxhd ) ) , 0);
+ if (lseek(ofil, (off_t)(HEADER_BYTES - sizeof(pxhd)), 0) == -1)
+ perror("magic2: lseek2"), panic("magic2");
write(ofil, (char *) (&pxhd), sizeof (pxhd));
}
#endif OBJ
write(ofil, (char *) (&pxhd), sizeof (pxhd));
}
#endif OBJ