Small cleanups and fixes.
authorPaul Smith <psmith@gnu.org>
Sun, 28 Apr 2013 21:31:46 +0000 (17:31 -0400)
committerPaul Smith <psmith@gnu.org>
Sun, 28 Apr 2013 21:31:46 +0000 (17:31 -0400)
filedef.h
job.c
makeint.h
tests/scripts/features/output-sync

index 274973844b063c527ff03ebf4bad21c4537107db..b6ba2420eafdb917811a72c007cbcd5ce16b88bc 100644 (file)
--- 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 07d70c737032b799be149eaf4f43f29f26a90455..6ee6b8f9bc6b8e31ce41e6d1e32d2567ec3f7bb8 100644 (file)
--- 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)
index 643b6113b5209c806b3d8915ce186c50d6374aa9..8ac3861429af5f348b6aabf086300ebef7c6b7f3 100644 (file)
--- 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
index babc08f2d2e09479c68479f7e69ff062d3cde636..d1b743d3a364037247a45a7d1908a82dde2c9112 100644 (file)
@@ -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'