diff --git a/usr.bin/make/compat.c b/usr.bin/make/compat.c index affbf09ec04d..903af00c2f4f 100644 --- a/usr.bin/make/compat.c +++ b/usr.bin/make/compat.c @@ -1,4 +1,4 @@ -/* $NetBSD: compat.c,v 1.241 2022/08/17 20:10:29 rillig Exp $ */ +/* $NetBSD: compat.c,v 1.242 2022/10/10 21:17:25 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. @@ -91,7 +91,7 @@ #include "pathnames.h" /* "@(#)compat.c 8.2 (Berkeley) 3/19/94" */ -MAKE_RCSID("$NetBSD: compat.c,v 1.241 2022/08/17 20:10:29 rillig Exp $"); +MAKE_RCSID("$NetBSD: compat.c,v 1.242 2022/10/10 21:17:25 rillig Exp $"); static GNode *curTarg = NULL; static pid_t compatChild; @@ -107,7 +107,7 @@ CompatDeleteTarget(GNode *gn) if (gn != NULL && !GNode_IsPrecious(gn)) { const char *file = GNode_VarTarget(gn); - if (!opts.noExecute && unlink_file(file)) { + if (!opts.noExecute && unlink_file(file) == 0) { Error("*** %s removed", file); } } diff --git a/usr.bin/make/job.c b/usr.bin/make/job.c index f69627797244..81aad32326f2 100644 --- a/usr.bin/make/job.c +++ b/usr.bin/make/job.c @@ -1,4 +1,4 @@ -/* $NetBSD: job.c,v 1.455 2022/09/03 08:41:07 rillig Exp $ */ +/* $NetBSD: job.c,v 1.456 2022/10/10 21:17:25 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. @@ -142,7 +142,7 @@ #include "trace.h" /* "@(#)job.c 8.2 (Berkeley) 3/19/94" */ -MAKE_RCSID("$NetBSD: job.c,v 1.455 2022/09/03 08:41:07 rillig Exp $"); +MAKE_RCSID("$NetBSD: job.c,v 1.456 2022/10/10 21:17:25 rillig Exp $"); /* * A shell defines how the commands are run. All commands for a target are @@ -512,7 +512,7 @@ JobDeleteTarget(GNode *gn) return; file = GNode_Path(gn); - if (unlink_file(file)) + if (unlink_file(file) == 0) Error("*** %s removed", file); } diff --git a/usr.bin/make/main.c b/usr.bin/make/main.c index 30bdee647220..cebe3cf814d7 100644 --- a/usr.bin/make/main.c +++ b/usr.bin/make/main.c @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.584 2022/10/10 17:33:35 rillig Exp $ */ +/* $NetBSD: main.c,v 1.585 2022/10/10 21:17:25 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -111,7 +111,7 @@ #include "trace.h" /* "@(#)main.c 8.3 (Berkeley) 3/19/94" */ -MAKE_RCSID("$NetBSD: main.c,v 1.584 2022/10/10 17:33:35 rillig Exp $"); +MAKE_RCSID("$NetBSD: main.c,v 1.585 2022/10/10 21:17:25 rillig Exp $"); #if defined(MAKE_NATIVE) && !defined(lint) __COPYRIGHT("@(#) Copyright (c) 1988, 1989, 1990, 1993 " "The Regents of the University of California. " @@ -1881,13 +1881,13 @@ Finish(int errs) Fatal("%d error%s", errs, errs == 1 ? "" : "s"); } -bool +int unlink_file(const char *file) { struct stat st; if (lstat(file, &st) == -1) - return false; + return -1; if (S_ISDIR(st.st_mode)) { /* @@ -1895,9 +1895,9 @@ unlink_file(const char *file) * a directory unless [...]". */ errno = EISDIR; - return false; + return -1; } - return unlink(file) == 0; + return unlink(file); } static void diff --git a/usr.bin/make/make.h b/usr.bin/make/make.h index e8b329d718bd..dbf59ce1a6cd 100644 --- a/usr.bin/make/make.h +++ b/usr.bin/make/make.h @@ -1,4 +1,4 @@ -/* $NetBSD: make.h,v 1.307 2022/09/24 16:13:48 rillig Exp $ */ +/* $NetBSD: make.h,v 1.308 2022/10/10 21:17:25 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -842,7 +842,7 @@ void Fatal(const char *, ...) MAKE_ATTR_PRINTFLIKE(1, 2) MAKE_ATTR_DEAD; void Punt(const char *, ...) MAKE_ATTR_PRINTFLIKE(1, 2) MAKE_ATTR_DEAD; void DieHorribly(void) MAKE_ATTR_DEAD; void Finish(int) MAKE_ATTR_DEAD; -bool unlink_file(const char *) MAKE_ATTR_USE; +int unlink_file(const char *) MAKE_ATTR_USE; void execDie(const char *, const char *); char *getTmpdir(void) MAKE_ATTR_USE; bool ParseBoolean(const char *, bool) MAKE_ATTR_USE;