aboutsummaryrefslogtreecommitdiff
path: root/net/sup/files/patch-ac
diff options
context:
space:
mode:
Diffstat (limited to 'net/sup/files/patch-ac')
-rw-r--r--net/sup/files/patch-ac96
1 files changed, 0 insertions, 96 deletions
diff --git a/net/sup/files/patch-ac b/net/sup/files/patch-ac
index 1da07266614d..72885cc2183d 100644
--- a/net/sup/files/patch-ac
+++ b/net/sup/files/patch-ac
@@ -138,99 +138,3 @@ diff -u -r1.1.1.1 -r1.3
fprintf (noteF,"SUP Upgrade of %s at %s",
collrelname,ctime (&tloc));
(void) fflush (noteF);
-Index: supfilesrv.c
-===================================================================
-RCS file: /home/ncvs/src/usr.sbin/sup/supfilesrv/supfilesrv.c,v
-retrieving revision 1.4
-retrieving revision 1.6
-diff -u -r1.4 -r1.6
---- supfilesrv.c 1996/02/06 19:03:58 1.4
-+++ supfilesrv.c 1996/09/24 08:43:04 1.6
-@@ -254,7 +254,6 @@
- #include <sys/wait.h>
- #include <sys/stat.h>
- #include <sys/file.h>
--#include <sys/dir.h>
- #if MACH
- #include <sys/ioctl.h>
- #endif
-@@ -277,7 +276,6 @@
- #endif /* lint */
-
- extern int errno;
--long time ();
- uid_t getuid ();
-
- int maxchildren;
-@@ -1218,6 +1216,7 @@
- register int fdtmp;
- char sys_com[STRINGLENGTH], temp_file[STRINGLENGTH], rcs_file[STRINGLENGTH];
- union wait status;
-+ int wstat;
- char *uconvert(),*gconvert();
- int sendfile ();
-
-@@ -1285,15 +1284,54 @@
- #endif
- if (fd == -1) {
- if (docompress) {
-- tmpnam(temp_file);
-- sprintf(sys_com, "gzip -c < %s > %s\n", t->Tname, temp_file);
-- if (system(sys_com) != 0) {
-- /* Just in case */
-- unlink(temp_file);
-- goaway ("We died trying to \"%s\"", sys_com);
-- t->Tmode = 0;
-- }
-- fd = open (temp_file,O_RDONLY,0);
-+ FILE *tf;
-+ int pid;
-+ int i;
-+
-+ tf = tmpfile();
-+ if (tf == NULL) {
-+ goaway("no temp file");
-+ t->Tmode = 0;
-+ goto out;
-+ }
-+ pid = fork();
-+ switch (pid) {
-+ case -1: /* fail */
-+ goaway("Could not fork");
-+ t->Tmode = 0;
-+ fclose(tf);
-+ break;
-+ case 0: /* child */
-+ close(1);
-+ dup(fileno(tf));/* write end */
-+ for(i = 3; i < 64; i++)
-+ close(i);
-+ execl("/usr/bin/gzip", "sup-gzip", "-c", t->Tname, 0);
-+ execl("/usr/local/bin/gzip", "sup-gzip", "-c", t->Tname, 0);
-+ execlp("gzip", "sup-gzip", "-c", t->Tname, 0);
-+ perror("gzip");
-+ _exit(1); /* pipe breaks */
-+ default: /* parent */
-+ wait(&wstat);
-+ if (WIFEXITED(wstat) &&
-+ WEXITSTATUS(wstat) > 0) {
-+ fclose(tf);
-+ goaway("gzip failed!");
-+ t->Tmode = 0;
-+ goto out;
-+ }
-+ if (WIFSIGNALED(wstat)) {
-+ fclose(tf);
-+ goaway("gzip died!");
-+ t->Tmode = 0;
-+ goto out;
-+ }
-+ fd = dup(fileno(tf));
-+ fclose(tf);
-+ lseek(fd, 0, 0);
-+ break;
-+ }
-+ out:
- }
- else
- fd = open (t->Tname,O_RDONLY,0);