BSD 4_3_Reno release
[unix-history] / usr / src / usr.bin / rdist / docmd.c
index f7fe6c5..647f32e 100644 (file)
@@ -2,11 +2,23 @@
  * Copyright (c) 1983 Regents of the University of California.
  * All rights reserved.
  *
  * Copyright (c) 1983 Regents of the University of California.
  * All rights reserved.
  *
- * %sccs.include.redist.c%
+ * Redistribution and use in source and binary forms are permitted
+ * provided that: (1) source distributions retain this entire copyright
+ * notice and comment, and (2) distributions including binaries display
+ * the following acknowledgement:  ``This product includes software
+ * developed by the University of California, Berkeley and its contributors''
+ * in the documentation or other materials provided with the distribution
+ * and in all advertising materials mentioning features or use of this
+ * software. Neither the name of the University nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)docmd.c    5.7 (Berkeley) %G%";
+static char sccsid[] = "@(#)docmd.c    5.6 (Berkeley) 6/1/90";
 #endif /* not lint */
 
 #include "defs.h"
 #endif /* not lint */
 
 #include "defs.h"
@@ -107,8 +119,8 @@ doarrow(filev, files, rhost, cmds)
                signal(SIGPIPE, lostconn);
                if (!makeconn(rhost))
                        return;
                signal(SIGPIPE, lostconn);
                if (!makeconn(rhost))
                        return;
-               if ((lfp = fopen(tempfile, "w")) == NULL) {
-                       fatal("cannot open %s\n", tempfile);
+               if ((lfp = fopen(tmpfile, "w")) == NULL) {
+                       fatal("cannot open %s\n", tmpfile);
                        exit(1);
                }
        }
                        exit(1);
                }
        }
@@ -142,9 +154,9 @@ done:
        }
        for (sc = cmds; sc != NULL; sc = sc->sc_next)
                if (sc->sc_type == NOTIFY)
        }
        for (sc = cmds; sc != NULL; sc = sc->sc_next)
                if (sc->sc_type == NOTIFY)
-                       notify(tempfile, rhost, sc->sc_args, 0);
+                       notify(tmpfile, rhost, sc->sc_args, 0);
        if (!nflag) {
        if (!nflag) {
-               (void) unlink(tempfile);
+               (void) unlink(tmpfile);
                for (; ihead != NULL; ihead = ihead->nextp) {
                        free(ihead);
                        if ((opts & IGNLNKS) || ihead->count == 0)
                for (; ihead != NULL; ihead = ihead->nextp) {
                        free(ihead);
                        if ((opts & IGNLNKS) || ihead->count == 0)
@@ -319,7 +331,7 @@ dodcolon(filev, files, stamp, cmds)
        if (nflag || (options & VERIFY))
                tfp = NULL;
        else {
        if (nflag || (options & VERIFY))
                tfp = NULL;
        else {
-               if ((tfp = fopen(tempfile, "w")) == NULL) {
+               if ((tfp = fopen(tmpfile, "w")) == NULL) {
                        error("%s: %s\n", stamp, strerror(errno));
                        return;
                }
                        error("%s: %s\n", stamp, strerror(errno));
                        return;
                }
@@ -344,9 +356,9 @@ dodcolon(filev, files, stamp, cmds)
                (void) fclose(tfp);
        for (sc = cmds; sc != NULL; sc = sc->sc_next)
                if (sc->sc_type == NOTIFY)
                (void) fclose(tfp);
        for (sc = cmds; sc != NULL; sc = sc->sc_next)
                if (sc->sc_type == NOTIFY)
-                       notify(tempfile, NULL, sc->sc_args, lastmod);
+                       notify(tmpfile, NULL, sc->sc_args, lastmod);
        if (!nflag && !(options & VERIFY))
        if (!nflag && !(options & VERIFY))
-               (void) unlink(tempfile);
+               (void) unlink(tmpfile);
 }
 
 /*
 }
 
 /*