From 5ab49da8d4ab0b8e6cb23c3cb1f927e4402db4fc Mon Sep 17 00:00:00 2001 From: Trent Huber Date: Wed, 6 Aug 2025 20:27:12 -0400 Subject: [PATCH] build() tweaks --- cbs.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/cbs.c b/cbs.c index fcbe83b..58ab322 100644 --- a/cbs.c +++ b/cbs.c @@ -152,15 +152,14 @@ void load(char type, char *target, char **objs) { void build(char *path) { char *absolute, *current; - pid_t cpid; int self, exists, rebuild; + pid_t cpid; struct stat src, exe; if (!(absolute = realpath(path, NULL))) err(EXIT_FAILURE, "Unable to resolve `%s'", path); if (!(current = getcwd(NULL, 0))) err(EXIT_FAILURE, "Unable to check current directory"); - cpid = 0; if (!(self = strcmp(absolute, current) == 0)) { if ((cpid = fork()) == -1) err(EXIT_FAILURE, "Unable to fork"); @@ -170,7 +169,7 @@ void build(char *path) { printf("cd %s/\n", path); if (chdir(path) == -1) err(EXIT_FAILURE, "Unable to change directory to `%s'", path); - } + } else cpid = 0; free(absolute); free(current); -- 2.51.0