From 8b034b7d18a08d3a2378e5b6fc9fbdd1b658f142 Mon Sep 17 00:00:00 2001 From: Paul Smith Date: Sun, 28 Apr 2013 17:31:46 -0400 Subject: Small cleanups and fixes. --- filedef.h | 10 +++++----- job.c | 4 ++-- makeint.h | 3 +++ tests/scripts/features/output-sync | 10 +++++----- 4 files changed, 15 insertions(+), 12 deletions(-) diff --git a/filedef.h b/filedef.h index 2749738..b6ba242 100644 --- a/filedef.h +++ b/filedef.h @@ -28,13 +28,9 @@ struct file const char *vpath; /* VPATH/vpath pathname */ struct dep *deps; /* all dependencies, including duplicates */ struct commands *cmds; /* Commands to execute for this target. */ - int command_flags; /* Flags OR'd in for cmds; see commands.h. */ const char *stem; /* Implicit stem, if an implicit rule has been used */ struct dep *also_make; /* Targets that are made by making this. */ - FILE_TIMESTAMP last_mtime; /* File's modtime, if already known. */ - FILE_TIMESTAMP mtime_before_update; /* File's modtime before any updating - has been performed. */ struct file *prev; /* Previous entry for same file name; used when there are multiple double-colon entries for the same file. */ @@ -59,7 +55,11 @@ struct file the same file. Otherwise this is null. */ struct file *double_colon; - short int update_status; /* Status of the last attempt to update, + FILE_TIMESTAMP last_mtime; /* File's modtime, if already known. */ + FILE_TIMESTAMP mtime_before_update; /* File's modtime before any updating + has been performed. */ + int command_flags; /* Flags OR'd in for cmds; see commands.h. */ + char update_status; /* Status of the last attempt to update, or -1 if none has been made. */ enum cmd_state /* State of the commands. */ { /* Note: It is important that cs_not_started be zero. */ diff --git a/job.c b/job.c index 07d70c7..6ee6b8f 100644 --- a/job.c +++ b/job.c @@ -659,7 +659,7 @@ acquire_semaphore (void) fl.l_type = F_WRLCK; fl.l_whence = SEEK_SET; - fl.l_start = 0; /* lock just one byte */ + fl.l_start = 0; fl.l_len = 1; if (fcntl (sync_handle, F_SETLKW, &fl) != -1) return &fl; @@ -976,7 +976,7 @@ reap_children (int block, int err) /* Search for a child matching the deceased one. */ lastc = 0; for (c = children; c != 0; lastc = c, c = c->next) - if (c->remote == remote && c->pid == pid) + if (c->pid == pid && c->remote == remote) break; if (c == 0) diff --git a/makeint.h b/makeint.h index 643b611..8ac3861 100644 --- a/makeint.h +++ b/makeint.h @@ -168,6 +168,9 @@ unsigned int get_path_max (void); (! INTEGER_TYPE_SIGNED (t) ? (t) 0 : ~ (t) 0 << (sizeof (t) * CHAR_BIT - 1)) #define INTEGER_TYPE_MAXIMUM(t) (~ (t) 0 - INTEGER_TYPE_MINIMUM (t)) +/* The maximum number of digits needed to represent the largest integer. */ +#define INTEGER_LENGTH sizeof("18446744073709551616") + #ifndef CHAR_MAX # define CHAR_MAX INTEGER_TYPE_MAXIMUM (char) #endif diff --git a/tests/scripts/features/output-sync b/tests/scripts/features/output-sync index babc08f..d1b743d 100644 --- a/tests/scripts/features/output-sync +++ b/tests/scripts/features/output-sync @@ -198,11 +198,11 @@ bar: end #MAKE#[1]: Leaving directory '#PWD#/bar' #MAKE#[1]: Entering directory '#PWD#/foo' Makefile:20: recipe for target 'foo-fail' failed -make[1]: Leaving directory '/home/psmith/src/make/make/tests/foo' -make[1]: Entering directory '/home/psmith/src/make/make/tests/foo' -make[1]: *** [foo-fail] Error 1 -make[1]: Leaving directory '/home/psmith/src/make/make/tests/foo' -make[1]: Entering directory '/home/psmith/src/make/make/tests/foo' +#MAKE#[1]: Leaving directory '/home/psmith/src/make/make/tests/foo' +#MAKE#[1]: Entering directory '/home/psmith/src/make/make/tests/foo' +#MAKE#[1]: *** [foo-fail] Error 1 +#MAKE#[1]: Leaving directory '/home/psmith/src/make/make/tests/foo' +#MAKE#[1]: Entering directory '/home/psmith/src/make/make/tests/foo' foo-fail: start foo-fail: end #MAKE#[1]: Leaving directory '#PWD#/foo' -- cgit v1.2.3