Small cleanups and fixes.

This commit is contained in:
Paul Smith 2013-04-28 17:31:46 -04:00
parent 93843ccd08
commit 8b034b7d18
4 changed files with 15 additions and 12 deletions

View file

@ -28,13 +28,9 @@ struct file
const char *vpath; /* VPATH/vpath pathname */ const char *vpath; /* VPATH/vpath pathname */
struct dep *deps; /* all dependencies, including duplicates */ struct dep *deps; /* all dependencies, including duplicates */
struct commands *cmds; /* Commands to execute for this target. */ 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 const char *stem; /* Implicit stem, if an implicit
rule has been used */ rule has been used */
struct dep *also_make; /* Targets that are made by making this. */ 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; struct file *prev; /* Previous entry for same file name;
used when there are multiple double-colon used when there are multiple double-colon
entries for the same file. */ entries for the same file. */
@ -59,7 +55,11 @@ struct file
the same file. Otherwise this is null. */ the same file. Otherwise this is null. */
struct file *double_colon; 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. */ or -1 if none has been made. */
enum cmd_state /* State of the commands. */ enum cmd_state /* State of the commands. */
{ /* Note: It is important that cs_not_started be zero. */ { /* Note: It is important that cs_not_started be zero. */

4
job.c
View file

@ -659,7 +659,7 @@ acquire_semaphore (void)
fl.l_type = F_WRLCK; fl.l_type = F_WRLCK;
fl.l_whence = SEEK_SET; fl.l_whence = SEEK_SET;
fl.l_start = 0; /* lock just one byte */ fl.l_start = 0;
fl.l_len = 1; fl.l_len = 1;
if (fcntl (sync_handle, F_SETLKW, &fl) != -1) if (fcntl (sync_handle, F_SETLKW, &fl) != -1)
return &fl; return &fl;
@ -976,7 +976,7 @@ reap_children (int block, int err)
/* Search for a child matching the deceased one. */ /* Search for a child matching the deceased one. */
lastc = 0; lastc = 0;
for (c = children; c != 0; lastc = c, c = c->next) 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; break;
if (c == 0) if (c == 0)

View file

@ -168,6 +168,9 @@ unsigned int get_path_max (void);
(! INTEGER_TYPE_SIGNED (t) ? (t) 0 : ~ (t) 0 << (sizeof (t) * CHAR_BIT - 1)) (! INTEGER_TYPE_SIGNED (t) ? (t) 0 : ~ (t) 0 << (sizeof (t) * CHAR_BIT - 1))
#define INTEGER_TYPE_MAXIMUM(t) (~ (t) 0 - INTEGER_TYPE_MINIMUM (t)) #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 #ifndef CHAR_MAX
# define CHAR_MAX INTEGER_TYPE_MAXIMUM (char) # define CHAR_MAX INTEGER_TYPE_MAXIMUM (char)
#endif #endif

View file

@ -198,11 +198,11 @@ bar: end
#MAKE#[1]: Leaving directory '#PWD#/bar' #MAKE#[1]: Leaving directory '#PWD#/bar'
#MAKE#[1]: Entering directory '#PWD#/foo' #MAKE#[1]: Entering directory '#PWD#/foo'
Makefile:20: recipe for target 'foo-fail' failed Makefile:20: recipe for target 'foo-fail' failed
make[1]: Leaving 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]: Entering directory '/home/psmith/src/make/make/tests/foo'
make[1]: *** [foo-fail] Error 1 #MAKE#[1]: *** [foo-fail] Error 1
make[1]: Leaving 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]: Entering directory '/home/psmith/src/make/make/tests/foo'
foo-fail: start foo-fail: start
foo-fail: end foo-fail: end
#MAKE#[1]: Leaving directory '#PWD#/foo' #MAKE#[1]: Leaving directory '#PWD#/foo'