Greetings,
Just to stir up some conversation and maybe to help any other people
running on Dynix/PTX on the list, I've attached four patched that
I'm running with right now.
Comments welcome,
Michael Sterrett
-Mr. Bones.-
[EMAIL PROTECTED]
diff -u commands.c gcommands.c
--- commands.c Tue Jun 13 10:24:43 2000
+++ gcommands.c Thu Mar 8 14:38:08 2001
@@ -493,7 +493,7 @@
}
#endif
- if (stat (file->name, &st) == 0
+ if (atomic_stat (file->name, &st) == 0
&& S_ISREG (st.st_mode)
&& FILE_TIMESTAMP_STAT_MODTIME (file->name, st) != file->last_mtime)
{
diff -u dir.c gdir.c
--- dir.c Mon May 8 14:26:00 2000
+++ gdir.c Fri Mar 9 13:21:10 2001
@@ -344,8 +350,8 @@
#ifdef VMS
r = vmsstat_dir (name, &st);
#else
- r = stat (name, &st);
+ r = atomic_stat (name, &st);
#endif
#ifdef WINDOWS32
/* Put back the trailing '\'. If we don't, we're permanently
@@ -540,7 +561,7 @@
*/
if (dir->path_key &&
(dir->fs_flags & FS_FAT ||
- (stat(dir->path_key, &st) == 0 &&
+ (atomic_stat(dir->path_key, &st) == 0 &&
st.st_mtime > dir->mtime))) {
/* reset date stamp to show most recent re-process */
@@ -1106,7 +1141,7 @@
char *path;
struct stat *buf;
{
- return stat (path, buf);
+ return atomic_stat (path, buf);
}
#endif
diff -u make.h gmake.h
--- make.h Thu Jun 15 01:25:37 2000
+++ gmake.h Thu Mar 8 14:37:25 2001
@@ -466,6 +466,8 @@
extern void make_access PARAMS ((void));
extern void child_access PARAMS ((void));
+extern int atomic_stat (const char *, struct stat *);
+
#ifdef HAVE_VFORK_H
# include <vfork.h>
#endif
diff -u misc.c gmisc.c
--- misc.c Tue Jun 20 10:00:17 2000
+++ gmisc.c Thu Mar 8 17:54:27 2001
@@ -857,3 +857,16 @@
return value;
}
#endif
+
+int
+atomic_stat (file_name, buf)
+const char *file_name;
+struct stat *buf;
+{
+
+if (strstr(file_name, "buyer"))
+printf("Called atomic_stat(%s)\n", file_name);
+ while (stat (file_name, buf) != 0)
+ if (errno != EINTR)
+ return errno;
+}
diff -u read.c gread.c
--- read.c Wed Jun 21 15:33:30 2000
+++ gread.c Thu Mar 8 14:40:39 2001
@@ -2464,7 +2464,7 @@
dir = expanded;
}
- if (stat (dir, &stbuf) == 0 && S_ISDIR (stbuf.st_mode))
+ if (atomic_stat (dir, &stbuf) == 0 && S_ISDIR (stbuf.st_mode))
{
if (idx == max - 1)
{
@@ -2497,7 +2497,7 @@
#endif
for (i = 0; default_include_directories[i] != 0; ++i)
- if (stat (default_include_directories[i], &stbuf) == 0
+ if (atomic_stat (default_include_directories[i], &stbuf) == 0
&& S_ISDIR (stbuf.st_mode))
dirs[idx++] = default_include_directories[i];
diff -u remake.c gremake.c
--- remake.c Tue Jun 20 10:00:17 2000
+++ gremake.c Thu Mar 8 14:48:25 2001
@@ -1228,13 +1213,12 @@
{
struct stat st;
- while (stat (name, &st) != 0)
- if (errno != EINTR)
- {
- if (errno != ENOENT && errno != ENOTDIR)
- perror_with_name ("stat:", name);
- return NONEXISTENT_MTIME;
- }
+ if (atomic_stat (name, &st) != 0)
+ {
+ if (errno != ENOENT && errno != ENOTDIR)
+ perror_with_name ("stat:", name);
+ return NONEXISTENT_MTIME;
+ }
return FILE_TIMESTAMP_STAT_MODTIME (name, st);
}
diff -u vmsfunctions.c gvmsfunctions.c
--- vmsfunctions.c Sat Feb 5 02:50:48 2000
+++ gvmsfunctions.c Thu Mar 8 14:40:48 2001
@@ -215,7 +215,7 @@
if (!(status & 1))
return -1;
- status = stat (name, buf);
+ status = atomic_stat (name, buf);
if (status)
return -1;
diff -u vpath.c gvpath.c
--- vpath.c Tue Jun 13 10:24:45 2000
+++ gvpath.c Thu Mar 8 18:30:30 2001
@@ -515,7 +522,7 @@
#endif
if (!exists_in_cache /* Makefile-mentioned file need not exist. */
- || stat (name, &st) == 0) /* Does it really exist? */
+ || atomic_stat (name, &st) == 0) /* Does it really exist? */
{
/* We have found a file.
Store the name we found into *FILE for the caller. */
diff -u remake.c make-3.78.1/remake.c
--- remake.c Thu Sep 9 11:30:27 1999
+++ remake.c Tue Feb 22 18:14:35 2000
@@ -214,21 +214,6 @@
if (stop || !any_not_updated)
{
- /* If we have found nothing whatever to do for the goal,
- print a message saying nothing needs doing. */
-
- if (!makefiles
- /* If the update_status is zero, we updated successfully
- or not at all. G->changed will have been set above if
- any commands were actually started for this goal. */
- && file->update_status == 0 && !g->changed
- /* Never give a message under -s or -q. */
- && !silent_flag && !question_flag)
- message (1, ((file->phony || file->cmds == 0)
- ? _("Nothing to be done for `%s'.")
- : _("`%s' is up to date.")),
- file->name);
-
/* This goal is finished. Remove it from the chain. */
if (lastgoal == 0)
goals = g->next;
diff -u dir.c dir.c
--- dir.c Mon May 8 14:26:00 2000
+++ dir.c Fri Mar 9 14:53:31 2001
@@ -559,13 +559,19 @@
return 0;
}
- while ((d = readdir (dir->dirstream)) != 0)
+ for(;;)
{
/* Enter the file in the hash table. */
register unsigned int newhash = 0;
unsigned int len;
register unsigned int i;
+ errno = 0;
+ if ((d = readdir (dir->dirstream)) == 0) {
+ if (errno == EINTR)
+ continue;
+ break;
+ }
#if defined(VMS) && defined(HAVE_DIRENT_H)
/* In VMS we get file versions too, which have to be stripped off */
{
diff -u function.c function.c
--- function.c Tue Jun 20 10:00:16 2000
+++ function.c Fri Mar 9 14:08:25 2001
@@ -234,7 +234,7 @@
int len = strlen (s);
for (; table->name != NULL; ++table)
- if (table->len <= len
+ if ((int)table->len <= len
&& (isblank ((unsigned char)s[table->len]) || s[table->len] == '\0')
&& strneq (s, table->name, table->len))
return table;
@@ -1683,7 +1683,7 @@
char **argv;
struct function_table_entry *entry_p;
{
- if (argc < entry_p->minimum_args)
+ if (argc < (int)entry_p->minimum_args)
fatal (reading_file,
_("Insufficient number of arguments (%d) to function `%s'"),
argc, entry_p->name);