From c73320deba35f57dabb5c7826c9349c14c7440c5 Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Fri, 14 Apr 2000 15:12:38 +0000 Subject: [PATCH] * setup.c (tarx): Wait to after tar has completed to reset protections or suffer races with tar process. --- ChangeLog | 5 +++++ setup.c | 9 +++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index ed37f9ee..fc12a504 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Fri Apr 14 11:11:29 2000 Christopher Faylor + + * setup.c (tarx): Wait to after tar has completed to reset protections + or suffer races with tar process. + Thu Apr 13 12:51:19 2000 Christopher Faylor * Makefile.in: Eliminate duplicate -nostdinc from CFLAGS. diff --git a/setup.c b/setup.c index 4a5d216b..cd566f29 100644 --- a/setup.c +++ b/setup.c @@ -164,6 +164,7 @@ tarx (const char *dir, const char *fn, FILE *logfp) int hpipe[2]; HANDLE hin; FILE *fp; + int filehere; dpath = pathcat (dir, fn); path = dtoupath (dpath); @@ -185,6 +186,7 @@ tarx (const char *dir, const char *fn, FILE *logfp) _close (hpipe[1]); fp = fdopen (hpipe[0], "rt"); + filehere = files.index; while (fgets (buffer, sizeof (buffer0), fp)) { char *s = strchr (buffer, '\n'); @@ -206,12 +208,15 @@ tarx (const char *dir, const char *fn, FILE *logfp) if (*s != '/') *--s = '/'; s = files.array[files.index] = utodpath (s); - (void) chmod (s, 0777); } fprintf (logfp, "%s\n", s); } fclose (fp); + + while (++filehere <= files.index) + (void) chmod (files.array[files.index], 0777); + return 1; } @@ -1198,7 +1203,7 @@ main () xfree (wd); } - printf ("\nInstall took %.0f seconds.\n", + printf ("\nInstallation took %.0f seconds.\n", (double) (clock () - start) / CLK_TCK); return retval; -- 2.43.5