BSD 4_3_Reno release
[unix-history] / usr / src / usr.sbin / mtree / create.c
index 29dee19..b7cfbba 100644 (file)
@@ -2,11 +2,23 @@
  * Copyright (c) 1989 The Regents of the University of California.
  * All rights reserved.
  *
  * Copyright (c) 1989 The 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[] = "@(#)create.c   5.11 (Berkeley) %G%";
+static char sccsid[] = "@(#)create.c   5.14 (Berkeley) 6/25/90";
 #endif /* not lint */
 
 #include <sys/param.h>
 #endif /* not lint */
 
 #include <sys/param.h>
@@ -35,6 +47,7 @@ cwalk()
        gid_t gid;
        mode_t mode;
        int tabs, dsort();
        gid_t gid;
        mode_t mode;
        int tabs, dsort();
+       char *argv[2];
        char curp[MAXPATHLEN], *inotype(), *getlogin(), *rlink();
 
        if (!getwd(curp)) {
        char curp[MAXPATHLEN], *inotype(), *getlogin(), *rlink();
 
        if (!getwd(curp)) {
@@ -45,7 +58,9 @@ cwalk()
        (void)printf("#\t  fs: %s\n#\t  by: %s\n#\tdate: %s\n",
            curp, getlogin(), ctime(&clock));
 
        (void)printf("#\t  fs: %s\n#\t  by: %s\n#\tdate: %s\n",
            curp, getlogin(), ctime(&clock));
 
-       if (!(t = ftsopen(".", ftsoptions, dsort))) {
+       argv[0] = ".";
+       argv[1] = (char *)NULL;
+       if (!(t = ftsopen(argv, ftsoptions, dsort))) {
                (void)fprintf(stderr,
                    "mtree: ftsopen: %s.\n", strerror(errno));
                exit(1);
                (void)fprintf(stderr,
                    "mtree: ftsopen: %s.\n", strerror(errno));
                exit(1);
@@ -127,6 +142,8 @@ cwalk()
                }
                LABEL;
                (void)printf("size=%ld", p->fts_statb.st_size);
                }
                LABEL;
                (void)printf("size=%ld", p->fts_statb.st_size);
+               LABEL;
+               (void)printf("time=%ld", p->fts_statb.st_mtime);
 
                if (p->fts_info == FTS_SL || p->fts_info == FTS_SLNONE) {
                        LABEL;
 
                if (p->fts_info == FTS_SL || p->fts_info == FTS_SLNONE) {
                        LABEL;
@@ -134,6 +151,7 @@ cwalk()
                }
                (void)putchar('\n');
        }
                }
                (void)putchar('\n');
        }
+       (void)ftsclose(t);
 }
 
 #define        MAXGID  5000
 }
 
 #define        MAXGID  5000