fix pr/1421 and pr/1997

This commit is contained in:
christos 1996-02-04 22:20:27 +00:00
parent b941a324f5
commit 8862d696fa
7 changed files with 37 additions and 30 deletions

View File

@ -1,8 +1,8 @@
# $NetBSD: Makefile,v 1.8 1995/06/14 15:18:37 christos Exp $
# $NetBSD: Makefile,v 1.9 1996/02/04 22:20:27 christos Exp $
# @(#)Makefile 5.2 (Berkeley) 12/28/90
PROG= make
CFLAGS+= -I${.CURDIR} -DPOSIX
CFLAGS+= -I${.CURDIR} -DPOSIX -DSYSVINCLUDE
SRCS= arch.c buf.c compat.c cond.c dir.c for.c hash.c job.c main.c \
make.c parse.c str.c suff.c targ.c var.c
SRCS+= lstAppend.c lstAtEnd.c lstAtFront.c lstClose.c lstConcat.c \

View File

@ -1,4 +1,4 @@
/* $NetBSD: arch.c,v 1.12 1996/02/04 20:34:41 christos Exp $ */
/* $NetBSD: arch.c,v 1.13 1996/02/04 22:20:34 christos Exp $ */
/*
* Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@ -42,7 +42,7 @@
#if 0
static char sccsid[] = "@(#)arch.c 5.7 (Berkeley) 12/28/90";
#else
static char rcsid[] = "$NetBSD: arch.c,v 1.12 1996/02/04 20:34:41 christos Exp $";
static char rcsid[] = "$NetBSD: arch.c,v 1.13 1996/02/04 22:20:34 christos Exp $";
#endif
#endif /* not lint */
@ -103,6 +103,7 @@ static char rcsid[] = "$NetBSD: arch.c,v 1.12 1996/02/04 20:34:41 christos Exp $
#if !defined(__svr4__) && !defined(__SVR4)
#include <ranlib.h>
#endif
#include <utime.h>
#include <stdio.h>
#include <stdlib.h>
#include "make.h"
@ -837,7 +838,7 @@ Arch_TouchLib (gn)
#ifdef RANLIBMAG
FILE * arch; /* Stream open to archive */
struct ar_hdr arh; /* Header describing table of contents */
struct timeval times[2]; /* Times for utimes() call */
struct utimbuf times; /* Times for utime() call */
arch = ArchFindMember (gn->path, RANLIBMAG, &arh, "r+");
sprintf(arh.ar_date, "%-12ld", (long) now);
@ -846,9 +847,8 @@ Arch_TouchLib (gn)
(void)fwrite ((char *)&arh, sizeof (struct ar_hdr), 1, arch);
fclose (arch);
times[0].tv_sec = times[1].tv_sec = now;
times[0].tv_usec = times[1].tv_usec = 0;
utimes(gn->path, times);
times.actime = times.modtime = now;
utime(gn->path, &times);
}
#endif
}
@ -991,7 +991,7 @@ Arch_FindLib (gn, path)
Var_Set (TARGET, gn->name, gn);
#else
Var_Set (TARGET, gn->path == (char *) NULL ? gn->name : gn->path, gn);
#endif LIBRARIES
#endif /* LIBRARIES */
}
/*-

View File

@ -1,4 +1,4 @@
/* $NetBSD: dir.c,v 1.9 1995/11/22 17:40:05 christos Exp $ */
/* $NetBSD: dir.c,v 1.10 1996/02/04 22:20:38 christos Exp $ */
/*
* Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@ -42,7 +42,7 @@
#if 0
static char sccsid[] = "@(#)dir.c 5.6 (Berkeley) 12/28/90";
#else
static char rcsid[] = "$NetBSD: dir.c,v 1.9 1995/11/22 17:40:05 christos Exp $";
static char rcsid[] = "$NetBSD: dir.c,v 1.10 1996/02/04 22:20:38 christos Exp $";
#endif
#endif /* not lint */
@ -1065,7 +1065,7 @@ Dir_AddDir (path, name)
(void)readdir(d);
while ((dp = readdir (d)) != (struct dirent *) NULL) {
#if defined(sun) && !defined(__svr4__)
#if defined(sun) && defined(d_ino) /* d_ino is a sunos4 #define for d_fileno */
/*
* The sun directory library doesn't check for a 0 inode
* (0-inode slots just take up space), so we have to do
@ -1074,7 +1074,7 @@ Dir_AddDir (path, name)
if (dp->d_fileno == 0) {
continue;
}
#endif /* sun && !__svr4__ */
#endif /* sun && d_ino */
(void)Hash_CreateEntry(&p->files, dp->d_name, (Boolean *)NULL);
}
(void) closedir (d);

View File

@ -1,4 +1,4 @@
/* $NetBSD: job.c,v 1.13 1995/11/22 17:40:09 christos Exp $ */
/* $NetBSD: job.c,v 1.14 1996/02/04 22:20:42 christos Exp $ */
/*
* Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@ -42,7 +42,7 @@
#if 0
static char sccsid[] = "@(#)job.c 5.15 (Berkeley) 3/1/91";
#else
static char rcsid[] = "$NetBSD: job.c,v 1.13 1995/11/22 17:40:09 christos Exp $";
static char rcsid[] = "$NetBSD: job.c,v 1.14 1996/02/04 22:20:42 christos Exp $";
#endif
#endif /* not lint */
@ -109,6 +109,7 @@ static char rcsid[] = "$NetBSD: job.c,v 1.13 1995/11/22 17:40:09 christos Exp $"
#include <sys/wait.h>
#include <fcntl.h>
#include <errno.h>
#include <utime.h>
#include <signal.h>
#include <stdio.h>
#include <string.h>
@ -375,6 +376,7 @@ JobPassSig(signo)
int signo; /* The signal number we've received */
{
sigset_t nmask, omask;
struct sigaction act;
if (DEBUG(JOB)) {
(void) fprintf(stdout, "JobPassSig(%d) called.\n", signo);
@ -406,8 +408,13 @@ JobPassSig(signo)
* This ensures that all our jobs get continued when we wake up before
* we take any other signal.
*/
sigfillset(&nmask);
(void) sigprocmask(SIG_BLOCK, &nmask, &omask);
sigemptyset(&nmask);
sigaddset(&nmask, signo);
sigprocmask(SIG_SETMASK, &nmask, &omask);
act.sa_handler = SIG_DFL;
sigemptyset(&act.sa_mask);
act.sa_flags = 0;
sigaction(signo, &act, NULL);
if (DEBUG(JOB)) {
(void) fprintf(stdout,
@ -423,8 +430,9 @@ JobPassSig(signo)
Lst_ForEach(jobs, JobCondPassSig, (ClientData) &signo);
(void) sigprocmask(SIG_SETMASK, &omask, NULL);
(void) signal(signo, JobPassSig);
sigprocmask(SIG_SETMASK, &omask, NULL);
act.sa_handler = JobPassSig;
sigaction(signo, &act, NULL);
}
/*-
@ -1009,7 +1017,7 @@ Job_Touch(gn, silent)
Boolean silent; /* TRUE if should not print messages */
{
int streamID; /* ID of stream opened to do the touch */
struct timeval times[2]; /* Times for utimes() call */
struct utimbuf times; /* Times for utime() call */
if (gn->type & (OP_JOIN|OP_USE|OP_EXEC|OP_OPTIONAL)) {
/*
@ -1035,9 +1043,8 @@ Job_Touch(gn, silent)
} else {
char *file = gn->path ? gn->path : gn->name;
times[0].tv_sec = times[1].tv_sec = now;
times[0].tv_usec = times[1].tv_usec = 0;
if (utimes(file, times) < 0){
times.actime = times.modtime = now;
if (utime(file, &times) < 0){
streamID = open(file, O_RDWR | O_CREAT, 0666);
if (streamID >= 0) {

View File

@ -1,4 +1,4 @@
/* $NetBSD: lst.h,v 1.5 1995/06/14 15:19:31 christos Exp $ */
/* $NetBSD: lst.h,v 1.6 1996/02/04 22:20:46 christos Exp $ */
/*
* Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@ -48,7 +48,7 @@
#define _LST_H_
#include <sprite.h>
#include <sys/cdefs.h>
#include <sys/param.h>
#if __STDC__
#include <stdlib.h>
#endif

View File

@ -1,4 +1,4 @@
/* $NetBSD: main.c,v 1.23 1995/11/22 17:40:14 christos Exp $ */
/* $NetBSD: main.c,v 1.24 1996/02/04 22:20:49 christos Exp $ */
/*
* Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@ -48,7 +48,7 @@ char copyright[] =
#if 0
static char sccsid[] = "@(#)main.c 5.25 (Berkeley) 4/1/91";
#else
static char rcsid[] = "$NetBSD: main.c,v 1.23 1995/11/22 17:40:14 christos Exp $";
static char rcsid[] = "$NetBSD: main.c,v 1.24 1996/02/04 22:20:49 christos Exp $";
#endif
#endif /* not lint */
@ -103,7 +103,7 @@ static char rcsid[] = "$NetBSD: main.c,v 1.23 1995/11/22 17:40:14 christos Exp $
#ifndef DEFMAXLOCAL
#define DEFMAXLOCAL DEFMAXJOBS
#endif DEFMAXLOCAL
#endif /* DEFMAXLOCAL */
#define MAKEFLAGS ".MAKEFLAGS"

View File

@ -1,4 +1,4 @@
/* $NetBSD: make.h,v 1.7 1995/12/16 05:03:11 christos Exp $ */
/* $NetBSD: make.h,v 1.8 1996/02/04 22:20:53 christos Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@ -52,7 +52,7 @@
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#ifndef MAKE_BOOTSTRAP
#if !defined(MAKE_BOOTSTRAP) && defined(BSD)
#include <sys/cdefs.h>
#else
#if defined(__STDC__) || defined(__cplusplus)