From 49d2284a1f93c7bde8e1f4707ee5181668877f91 Mon Sep 17 00:00:00 2001 From: Marc Espie Date: Sun, 23 Sep 2007 09:39:19 +0000 Subject: zap sunos bug work-around --- usr.bin/make/job.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'usr.bin/make') diff --git a/usr.bin/make/job.c b/usr.bin/make/job.c index 59b99e97fb7..21f50fbfa98 100644 --- a/usr.bin/make/job.c +++ b/usr.bin/make/job.c @@ -1,5 +1,5 @@ /* $OpenPackages$ */ -/* $OpenBSD: job.c,v 1.80 2007/09/18 08:27:22 espie Exp $ */ +/* $OpenBSD: job.c,v 1.81 2007/09/23 09:39:18 espie Exp $ */ /* $NetBSD: job.c,v 1.16 1996/11/06 17:59:08 christos Exp $ */ /* @@ -191,12 +191,6 @@ static int aborting = 0; /* why is the make aborting? */ #define ABORT_INTERRUPT 2 /* Because it was interrupted */ #define ABORT_WAIT 3 /* Waiting for jobs to finish */ -/* - * XXX: Avoid SunOS bug... FILENO() is fp->_file, and file - * is a char! So when we go above 127 we turn negative! - */ -#define FILENO(a) ((unsigned) fileno(a)) - static int numCommands; /* The number of commands actually printed * for a target. Should this number be * 0, no shell will be executed. */ @@ -990,7 +984,7 @@ JobExec(Job *job, char **argv) * marked close-on-exec, we must clear that bit in the new * input. */ - if (dup2(FILENO(job->cmdFILE), 0) == -1) + if (dup2(fileno(job->cmdFILE), 0) == -1) Punt("Cannot dup2: %s", strerror(errno)); (void)fcntl(0, F_SETFD, 0); (void)lseek(0, 0, SEEK_SET); @@ -1313,7 +1307,7 @@ JobStart(GNode *gn, /* target to create */ if (job->cmdFILE == NULL) { Punt("Could not open %s", tfile); } - (void)fcntl(FILENO(job->cmdFILE), F_SETFD, 1); + (void)fcntl(fileno(job->cmdFILE), F_SETFD, 1); /* * Send the commands to the command file, flush all its buffers * then rewind and remove the thing. -- cgit v1.2.3