ast@cs.vu.nl (Andy Tanenbaum) (05/30/88)
: This is a shar archive. Extract with sh, not csh.
: This archive ends with exit, so do not worry about trailing junk.
: --------------------------- cut here --------------------------
PATH=/bin:/usr/bin:/usr/ucb
echo Extracting 'cal.c.diff'
sed 's/^X//' > 'cal.c.diff' << '+ END-OF-FILE ''cal.c.diff'
X3c3
X< #include "../include/stdio.h"
X---
X> #include <stdio.h>
+ END-OF-FILE cal.c.diff
chmod 'u=rw,g=r,o=r' 'cal.c.diff'
set `wc -c 'cal.c.diff'`
count=$1
case $count in
61) :;;
*) echo 'Bad character count in ''cal.c.diff' >&2
echo 'Count should be 61' >&2
esac
echo Extracting 'cat.c.diff'
sed 's/^X//' > 'cat.c.diff' << '+ END-OF-FILE ''cat.c.diff'
X5,6c5,7
X< #include "blocksize.h"
X< #include "stat.h"
X---
X> #include <minix/blocksize.h>
X> #include <sys/types.h>
X> #include <sys/stat.h>
+ END-OF-FILE cat.c.diff
chmod 'u=rw,g=r,o=r' 'cat.c.diff'
set `wc -c 'cat.c.diff'`
count=$1
case $count in
137) :;;
*) echo 'Bad character count in ''cat.c.diff' >&2
echo 'Count should be 137' >&2
esac
echo Extracting 'cc.c.diff'
sed 's/^X//' > 'cc.c.diff' << '+ END-OF-FILE ''cc.c.diff'
X31c31
X< !!!!_SEE_BELOW_!!!
X---
X> !!! AH HA! I HAVE YOUR ATTENTION!
X43c43
X< /* #define MEM640K */
X---
X> /* #define MEM640K */
X137a138
X> exit(1);
+ END-OF-FILE cc.c.diff
chmod 'u=rw,g=r,o=r' 'cc.c.diff'
set `wc -c 'cc.c.diff'`
count=$1
case $count in
148) :;;
*) echo 'Bad character count in ''cc.c.diff' >&2
echo 'Count should be 148' >&2
esac
echo Extracting 'chmem.c.diff'
sed 's/^X//' > 'chmem.c.diff' << '+ END-OF-FILE ''chmem.c.diff'
X9c9
X< #define SEPBIT 0x00200000 /* this bit is set for separate I/D */
X---
X> #define SEPBIT 0x00200000 /* this bit is set for separate I/D */
X46c46
X< if ( (header[0] & 0xFFFF) != MAGIC)
X---
X> if ( (header[0] & 0xFFFFL) != MAGIC)
X54a55
X>
X55a57
X> if (separate == 0) newtot += header[TEXT];
X59d60
X< if (separate == 0) newtot += header[TEXT];
+ END-OF-FILE chmem.c.diff
chmod 'u=rw,g=r,o=r' 'chmem.c.diff'
set `wc -c 'chmem.c.diff'`
count=$1
case $count in
351) :;;
*) echo 'Bad character count in ''chmem.c.diff' >&2
echo 'Count should be 351' >&2
esac
echo Extracting 'chown.c.diff'
sed 's/^X//' > 'chown.c.diff' << '+ END-OF-FILE ''chown.c.diff'
X8,11c8,11
X< #include "pwd.h"
X< #include "../h/type.h"
X< #include "stat.h"
X< #include "stdio.h"
X---
X> #include <pwd.h>
X> #include <sys/types.h>
X> #include <sys/stat.h>
X> #include <stdio.h>
+ END-OF-FILE chown.c.diff
chmod 'u=rw,g=r,o=r' 'chown.c.diff'
set `wc -c 'chown.c.diff'`
count=$1
case $count in
188) :;;
*) echo 'Bad character count in ''chown.c.diff' >&2
echo 'Count should be 188' >&2
esac
echo Extracting 'clr.c.diff'
sed 's/^X//' > 'clr.c.diff' << '+ END-OF-FILE ''clr.c.diff'
X7c7
X< prints("\033 8\033~0");
X---
X> prints("\033[H\033[J");
+ END-OF-FILE clr.c.diff
chmod 'u=rw,g=r,o=r' 'clr.c.diff'
set `wc -c 'clr.c.diff'`
count=$1
case $count in
64) :;;
*) echo 'Bad character count in ''clr.c.diff' >&2
echo 'Count should be 64' >&2
esac
echo Extracting 'cp.c.diff'
sed 's/^X//' > 'cp.c.diff' << '+ END-OF-FILE ''cp.c.diff'
X3c3,4
X< #include "stat.h"
X---
X> #include <sys/types.h>
X> #include <sys/stat.h>
X43c44
X< copyfile(fd1, fd2);
X---
X> copyfile(fd1, fd2, argv[2]);
X89c90
X< copyfile(fd1, fd2);
X---
X> copyfile(fd1, fd2, dirname);
X97c98
X< copyfile(fd1, fd2)
X---
X> copyfile(fd1, fd2, name)
X98a100
X> char *name;
X108a111
X> unlink(name); /* don't leave truncated file around */
+ END-OF-FILE cp.c.diff
chmod 'u=rw,g=r,o=r' 'cp.c.diff'
set `wc -c 'cp.c.diff'`
count=$1
case $count in
355) :;;
*) echo 'Bad character count in ''cp.c.diff' >&2
echo 'Count should be 355' >&2
esac
echo Extracting 'cpdir.c.diff'
sed 's/^X//' > 'cpdir.c.diff' << '+ END-OF-FILE ''cpdir.c.diff'
X6,8c6,9
X< but the linking structure of the tree, and the owner and time
X< information of files are not yet preserved. (See the work-yet-to-be-done list
X< below.)
X---
X> but the linking structure of the tree is not yet preserved.
X> (See the work-yet-to-be-done list below.)
X> The -m "merge" flag enables you to copy into an existing directory.
X> The -s "similar" flag preserves the full mode, uid, gid and times.
X12,13c13
X< - preserve link structure, times, etc...
X< - 'stat' optimization (stat() is invoked twice for normal files)
X---
X> - preserve link structure
X15d14
X< * has been solved by letting 'cpdir' create the target directory
X22c21,23
X< #include "stdio.h"
X---
X> #include <stdio.h>
X> #include <sys/types.h>
X> #include <sys/stat.h>
X26,31d26
X< #ifdef UNIX
X< #include <sys/types.h>
X< #include <sys/stat.h>
X< #else !UNIX
X< #include "stat.h"
X< #endif
X38a34,35
X> int mflag = 0; /* force */
X> int sflag = 0; /* similar */
X45a43
X> struct stat st;
X55a54,59
X> case 'm':
X> mflag = 1;
X> break;
X> case 's':
X> sflag = 1;
X> break;
X62,63c66,70
X< fatal("Usage: cpdir [-v] source destination");
X< if (ftype(s = *argv++) != S_IFDIR)
X---
X> fatal("Usage: cpdir [-msv] source destination");
X> s = *argv++;
X> if (stat(s, &st) < 0)
X> fatal("can't get file status of %s", s);
X> if ((st.st_mode & S_IFMT) != S_IFDIR)
X65c72
X< cpdir(s, *argv);
X---
X> cpdir(&st, s, *argv);
X69c76,77
X< cpdir(s, d)
X---
X> cpdir(sp, s, d)
X> struct stat *sp;
X75a84,87
X> struct stat st;
X> static first = 1;
X> static dev_t dev;
X> static ino_t ino;
X77,81c89,90
X< while (*send++ = *s++) {}
X< send--;
X< while (*dend++ = *d++) {}
X< if ((fd = open(spath, 0)) < 0) {
X< nonfatal("can't read directory %s", spath);
X---
X> if ((fd = open(s, 0)) < 0) {
X> nonfatal("can't read directory %s", s);
X84,86c93,116
X< *send++ = '/';
X< ent[DIRSIZ] = '\0';
X< mkdir(dpath);
X---
X> if (
X> mflag == 0
X> ||
X> stat(d, &st) != 0
X> ||
X> (st.st_mode & S_IFMT) != S_IFDIR
X> ) {
X> mkdir(d);
X> if (sflag)
X> similar(sp, d);
X> }
X> if (first) {
X> stat(d, &st);
X> dev = st.st_dev;
X> ino = st.st_ino;
X> first = 0;
X> }
X> if (sp->st_dev == dev && sp->st_ino == ino) {
X> nonfatal("%s skipped to avoid an endless loop", s);
X> return;
X> }
X> while (*send++ = *s++) {}
X> while (*dend++ = *d++) {}
X> send[-1] = '/';
X87a118
X> ent[DIRSIZ] = '\0';
X95c126,128
X< switch (ftype(spath)) {
X---
X> if (stat(spath, &st) < 0)
X> fatal("can't get file status of %s", spath);
X> switch (st.st_mode & S_IFMT) {
X97c130
X< cpdir(spath, dpath);
X---
X> cpdir(&st, spath, dpath);
X100c133
X< cp(spath, dpath);
X---
X> cp(&st, spath, dpath);
X131c164,165
X< cp(s, d)
X---
X> cp(sp, s, d)
X> struct stat *sp;
X134d167
X< struct stat st;
X143,145c176
X< if (fstat(sfd, &st) < 0)
X< fatal("can't get file status of %s", s);
X< if ((dfd = creat(d, st.st_mode & 0777)) < 0)
X---
X> if ((dfd = creat(d, sp->st_mode & 0777)) < 0)
X148c179,180
X< write(dfd, buf, n);
X---
X> if (write(dfd, buf, n) != n)
X> fatal("error in writing file %s", d);
X152a185,186
X> if (sflag)
X> similar(sp, d);
X156,157c190,192
X< ftype(s)
X< char *s;
X---
X> similar(sp, d)
X> struct stat *sp;
X> char *d;
X159c194
X< struct stat st;
X---
X> time_t timep[2];
X161,163c196,200
X< if (stat(s, &st) < 0)
X< fatal("can't get file status of %s", s);
X< return st.st_mode & S_IFMT;
X---
X> chmod(d, sp->st_mode);
X> chown(d, sp->st_uid, sp->st_gid);
X> timep[0] = sp->st_atime;
X> timep[1] = sp->st_mtime;
X> utime(d, timep);
+ END-OF-FILE cpdir.c.diff
chmod 'u=rw,g=r,o=r' 'cpdir.c.diff'
set `wc -c 'cpdir.c.diff'`
count=$1
case $count in
3520) :;;
*) echo 'Bad character count in ''cpdir.c.diff' >&2
echo 'Count should be 3520' >&2
esac
echo Extracting 'date.c.diff'
sed 's/^X//' > 'date.c.diff' << '+ END-OF-FILE ''date.c.diff'
X3c3
X< #include "stdio.h"
X---
X> #include <stdio.h>
X116a117,118
X> if (tm.year < 0)
X> tm.year += 100;
+ END-OF-FILE date.c.diff
chmod 'u=rw,g=r,o=r' 'date.c.diff'
set `wc -c 'date.c.diff'`
count=$1
case $count in
102) :;;
*) echo 'Bad character count in ''date.c.diff' >&2
echo 'Count should be 102' >&2
esac
echo Extracting 'dd.c.diff'
sed 's/^X//' > 'dd.c.diff' << '+ END-OF-FILE ''dd.c.diff'
X1,2c1,2
X< #include "stdio.h"
X< #include "signal.h"
X---
X> #include <stdio.h>
X> #include <signal.h>
X49c49
X< done(1);
X---
X> exit(1);
X92c92
X< done(1);
X---
X> exit(1);
X108c108
X< done(0);
X---
X> exit(0);
X199c199
X< done(1);
X---
X> exit(1);
X206c206
X< done(1);
X---
X> exit(1);
X213c213
X< done(1);
X---
X> exit(1);
X218c218
X< done(1);
X---
X> exit(1);
X227c227
X< done(1);
X---
X> exit(1);
X231c231
X< done(1);
X---
X> exit(1);
X235c235
X< done(1);
X---
X> exit(1);
X239c239
X< done(1);
X---
X> exit(1);
X339,345d338
X< }
X<
X< done(n)
X< int n;
X< {
X< _cleanup(); /* flush stdio's internal buffers */
X< exit(n);
+ END-OF-FILE dd.c.diff
chmod 'u=rw,g=r,o=r' 'dd.c.diff'
set `wc -c 'dd.c.diff'`
count=$1
case $count in
622) :;;
*) echo 'Bad character count in ''dd.c.diff' >&2
echo 'Count should be 622' >&2
esac
echo Extracting 'df.c.diff'
sed 's/^X//' > 'df.c.diff' << '+ END-OF-FILE ''df.c.diff'
X3,8c3,10
X< #include "../h/const.h"
X< #include "../h/type.h"
X< #include "../fs/const.h"
X< #include "../fs/type.h"
X< #include "../fs/super.h"
X< #include "stat.h"
X---
X> #include <minix/const.h>
X> #include <minix/type.h>
X> #include <fs/const.h>
X> #include <fs/type.h>
X> #include <fs/super.h>
X> #include <sys/types.h>
X> #include <sys/stat.h>
X> #include <stdio.h>
X9a12,13
X> char *mtab = "/etc/mtab";
X>
X15d18
X<
X18,22d20
X< if (argc <= 1) {
X< std_err("Usage: df special ...\n");
X< exit(1);
X< }
X<
X23a22,23
X> if (argc == 1) defaults();
X>
X86c86
X< prints("%s ",name);
X---
X> prints("%s",name);
X93c93
X< prints(" used ");
X---
X> prints(" used ");
X97c97
X< prints(" used ");
X---
X> prints(" used ");
X148,150c148,151
X< if (n < 10) prints(" %s", itoa(n));
X< else if (n < 100) prints(" %s", itoa(n));
X< else if (n < 1000) prints(" %s", itoa(n));
X---
X> if (n < 10) prints(" %s", itoa(n));
X> else if (n < 100) prints(" %s", itoa(n));
X> else if (n < 1000) prints(" %s", itoa(n));
X> else if (n < 10000) prints(" %s", itoa(n));
X151a153,188
X> }
X>
X> defaults()
X> {
X> /* Use the root file system and all mounted file systems. */
X>
X> char buf[256];
X>
X> close(0);
X> if (open(mtab, 0) < 0) {
X> std_err("df: cannot open ");
X> std_err(mtab);
X> std_err("\n");
X> exit(1);
X> }
X>
X> /* Read /etc/mtab and iterate on the lines. */
X> while (1) {
X> getname(buf); /* getname exits upon hitting EOF */
X> df(buf);
X> }
X>
X> }
X>
X> getname(p)
X> char *p;
X> {
X> char c;
X>
X> while (1) {
X> c = getchar();
X> if (c < 0) exit(0);
X> if (c == ' ') c = 0;
X> *p++ = c;
X> if (c == '\n') return;
X> }
+ END-OF-FILE df.c.diff
chmod 'u=rw,g=r,o=r' 'df.c.diff'
set `wc -c 'df.c.diff'`
count=$1
case $count in
1629) :;;
*) echo 'Bad character count in ''df.c.diff' >&2
echo 'Count should be 1629' >&2
esac
echo Extracting 'diff.c.diff'
sed 's/^X//' > 'diff.c.diff' << '+ END-OF-FILE ''diff.c.diff'
X12c12
X< #include "stdio.h"
X---
X> #include <stdio.h>
X108c108
X< if ((p[1] & 0377) != '\377' && *p != '\n') {
X---
X> if ((p[1] & 0377) != 0377 && *p != '\n') {
+ END-OF-FILE diff.c.diff
chmod 'u=rw,g=r,o=r' 'diff.c.diff'
set `wc -c 'diff.c.diff'`
count=$1
case $count in
158) :;;
*) echo 'Bad character count in ''diff.c.diff' >&2
echo 'Count should be 158' >&2
esac
echo Extracting 'dosread.c.diff'
sed 's/^X//' > 'dosread.c.diff' << '+ END-OF-FILE ''dosread.c.diff'
X4a5
X> * This program uses the DOS 2.0 format and those compatible with it
X14c15
X< #include "stat.h"
X---
X> #include <sys/stat.h>
+ END-OF-FILE dosread.c.diff
chmod 'u=rw,g=r,o=r' 'dosread.c.diff'
set `wc -c 'dosread.c.diff'`
count=$1
case $count in
129) :;;
*) echo 'Bad character count in ''dosread.c.diff' >&2
echo 'Count should be 129' >&2
esac
echo Extracting 'du.c.diff'
sed 's/^X//' > 'du.c.diff' << '+ END-OF-FILE ''du.c.diff'
X15,18c15,18
X< #include "stdio.h"
X<
X< #include "stat.h"
X< #include "blocksize.h"
X---
X> #include <stdio.h>
X> #include <sys/types.h>
X> #include <sys/stat.h>
X> #include <minix/blocksize.h>
+ END-OF-FILE du.c.diff
chmod 'u=rw,g=r,o=r' 'du.c.diff'
set `wc -c 'du.c.diff'`
count=$1
case $count in
186) :;;
*) echo 'Bad character count in ''du.c.diff' >&2
echo 'Count should be 186' >&2
esac
echo Extracting 'fdisk.c.diff'
sed 's/^X//' > 'fdisk.c.diff' << '+ END-OF-FILE ''fdisk.c.diff'
X17c17
X< #include "stdio.h"
X---
X> #include <stdio.h>
+ END-OF-FILE fdisk.c.diff
chmod 'u=rw,g=r,o=r' 'fdisk.c.diff'
set `wc -c 'fdisk.c.diff'`
count=$1
case $count in
52) :;;
*) echo 'Bad character count in ''fdisk.c.diff' >&2
echo 'Count should be 52' >&2
esac
echo Extracting 'find.c.diff'
sed 's/^X//' > 'find.c.diff' << '+ END-OF-FILE ''find.c.diff'
X14c14
X< #include "stdio.h"
X---
X> #include <stdio.h>
X17c17,19
X< #include "stat.h"
X---
X> #include <sys/types.h>
X> #include <sys/stat.h>
X>
+ END-OF-FILE find.c.diff
chmod 'u=rw,g=r,o=r' 'find.c.diff'
set `wc -c 'find.c.diff'`
count=$1
case $count in
137) :;;
*) echo 'Bad character count in ''find.c.diff' >&2
echo 'Count should be 137' >&2
esac
echo Extracting 'fix.c.diff'
sed 's/^X//' > 'fix.c.diff' << '+ END-OF-FILE ''fix.c.diff'
X4c4
X< * files old and old.fix are equal after the following commands
X---
X> * files new and old.fix are equal after the following commands
X43c43
X< #define copy(str) printf("%s", str)
X---
X> #define copy(str) fputs(str,stdout);
X54c54
X< fatal("use: %s original-file diff-list-file", prog);
X---
X> fatal("Usage: %s original-file diff-list-file", prog);
X60a61
X>
X69c70
X< fatal("delete count conflict");
X---
X> fatal("delete count conflict n1 != n2");
X75c76
X< fatal("illegal delete line");
X---
X> fatal("no < in delete line");
X77c78
X< fatal("delete line conflict");
X---
X> fatal("delete line mismatch");
X83c84
X< fatal("illegal separator in chunk");
X---
X> fatal("no --- at end of change chunk");
X88,90c89,93
X< fatal("append count conflict");
X< copy(getline(fpf, obuf));
X< here++;
X---
X> fatal("append count conflict o1 != o2");
X> if (o1) {
X> copy(getline(fpf, obuf));
X> here++;
X> }
X94c97
X< fatal("illegal append line");
X---
X> fatal("no > in append line");
X128c131
X< if (v1 == 0 || v2 == 0 || v1 > v2)
X---
X> if (v1 > v2)
X159d161
X< fprintf(stderr, "%s: fatal: ", prog);
+ END-OF-FILE fix.c.diff
chmod 'u=rw,g=r,o=r' 'fix.c.diff'
set `wc -c 'fix.c.diff'`
count=$1
case $count in
1150) :;;
*) echo 'Bad character count in ''fix.c.diff' >&2
echo 'Count should be 1150' >&2
esac
echo Extracting 'grep.c.diff'
sed 's/^X//' > 'grep.c.diff' << '+ END-OF-FILE ''grep.c.diff'
X22,23c22,23
X< #include "regexp.h"
X< #include "stdio.h"
X---
X> #include <regexp.h>
X> #include <stdio.h>
X70c70
X< done(2);
X---
X> exit(2);
X94c94
X< done(status);
X---
X> exit(status);
X130c130
X< done(2);
X---
X> exit(2);
X148c148
X< done(2);
X---
X> exit(2);
X155c155,156
X< char *initbuf = buf, c;
X---
X> char *initbuf = buf;
X> int c;
X164,170d164
X< }
X<
X< done(n)
X< int n;
X< {
X< fflush(stdout);
X< exit(n);
+ END-OF-FILE grep.c.diff
chmod 'u=rw,g=r,o=r' 'grep.c.diff'
set `wc -c 'grep.c.diff'`
count=$1
case $count in
413) :;;
*) echo 'Bad character count in ''grep.c.diff' >&2
echo 'Count should be 413' >&2
esac
echo Extracting 'gres.c.diff'
sed 's/^X//' > 'gres.c.diff' << '+ END-OF-FILE ''gres.c.diff'
X20,21c20,21
X< #include "stdio.h"
X< #include "regexp.h"
X---
X> #include <stdio.h>
X> #include <regexp.h>
X47c47
X< done(2);
X---
X> exit(2);
X51c51
X< done(2);
X---
X> exit(2);
X55c55
X< done(2);
X---
X> exit(2);
X79c79
X< done(status);
X---
X> exit(status);
X114c114
X< done(2);
X---
X> exit(2);
X188,194d187
X< }
X<
X< done(n)
X< int n;
X< {
X< _cleanup(); /* flush stdio's internal buffers */
X< exit(n);
+ END-OF-FILE gres.c.diff
chmod 'u=rw,g=r,o=r' 'gres.c.diff'
set `wc -c 'gres.c.diff'`
count=$1
case $count in
400) :;;
*) echo 'Bad character count in ''gres.c.diff' >&2
echo 'Count should be 400' >&2
esac
echo Extracting 'head.c.diff'
sed 's/^X//' > 'head.c.diff' << '+ END-OF-FILE ''head.c.diff'
X2d1
X< /* change to use putc() instead of prints() -- Dean Long 3/7/87 */
X3a3
X> #include <stdio.h>
X5,6d4
X< #include "stdio.h"
X<
X9,10d6
X< char buff[BUFSIZ];
X<
X15c11
X<
X---
X> FILE *f;
X20d15
X< setbuf(stdout, buff);
X24c19
X< if (*ptr++ == '-') {
X---
X> if (argc > 1 && *ptr++ == '-') {
X33,34c28
X< do_file(n);
X< fflush(stdout);
X---
X> do_file(n, stdin);
X40,43c34,36
X< fclose(stdin);
X< if (nfiles > 1) prints("==> %s <==\n", argv[k]);
X< if (fopen(argv[k], "r") == NULL)
X< prints("head: cannot open %s\n", argv[k]);
X---
X> if (nfiles > 1) printf("==> %s <==\n", argv[k]);
X> if ((f = fopen(argv[k], "r")) == NULL)
X> printf("head: cannot open %s\n", argv[k]);
X45,46c38,39
X< do_file(n);
X< fflush(stdout);
X---
X> do_file(n, f);
X> fclose(f);
X49c42
X< if (k < argc) prints("\n");
X---
X> if (k < argc) printf("\n");
X56c49
X< do_file(n)
X---
X> do_file(n, f)
X57a51
X> FILE *f;
X63c57
X< switch (c = getc(stdin)) {
X---
X> switch (c = getc(f)) {
X76c70
X< std_err("Usage: head [-n] [file ...]\n");
X---
X> fprintf(stderr, "Usage: head [-n] [file ...]\n");
X79d72
X<
+ END-OF-FILE head.c.diff
chmod 'u=rw,g=r,o=r' 'head.c.diff'
set `wc -c 'head.c.diff'`
count=$1
case $count in
1102) :;;
*) echo 'Bad character count in ''head.c.diff' >&2
echo 'Count should be 1102' >&2
esac
echo Extracting 'kill.c.diff'
sed 's/^X//' > 'kill.c.diff' << '+ END-OF-FILE ''kill.c.diff'
X3c3
X< #include "../h/signal.h"
X---
X> #include <signal.h>
X12c12
X< if (*argv[1] == '-') {
X---
X> if (argc > 1 && *argv[1] == '-') {
X14c14,16
X< *argv++;
X---
X> if (!signal)
X> usage();
X> argv++;
X17d18
X< if (!signal) signal = SIGTERM;
X19c20
X< *argv++;
X---
X> argv++;
X33c34
X< prints("Usage: kill pid\n");
X---
X> prints("Usage: kill [-sig] pid\n");
+ END-OF-FILE kill.c.diff
chmod 'u=rw,g=r,o=r' 'kill.c.diff'
set `wc -c 'kill.c.diff'`
count=$1
case $count in
355) :;;
*) echo 'Bad character count in ''kill.c.diff' >&2
echo 'Count should be 355' >&2
esac
echo Extracting 'ln.c.diff'
sed 's/^X//' > 'ln.c.diff' << '+ END-OF-FILE ''ln.c.diff'
X3,4c3,6
X< #include "stat.h"
X< char name[17];
X---
X> #include <sys/types.h>
X> #include <sys/stat.h>
X>
X> char name[256];
+ END-OF-FILE ln.c.diff
chmod 'u=rw,g=r,o=r' 'ln.c.diff'
set `wc -c 'ln.c.diff'`
count=$1
case $count in
119) :;;
*) echo 'Bad character count in ''ln.c.diff' >&2
echo 'Count should be 119' >&2
esac
echo Extracting 'login.c.diff'
sed 's/^X//' > 'login.c.diff' << '+ END-OF-FILE ''login.c.diff'
X3,5c3,5
X< #include "signal.h"
X< #include "sgtty.h"
X< #include "pwd.h"
X---
X> #include <signal.h>
X> #include <sgtty.h>
X> #include <pwd.h>
X6a7,9
X> char home[100] = "HOME=";
X> char *env[] = { home, 0 };
X>
X43a47
X> if (bad) crypt(buf1, "*"); /* be as slow */
X53a58
X> strcpy(pwd->pw_dir, home+5);
X55c60
X< execl(pwd->pw_shell, "-", (char *) 0);
X---
X> execle(pwd->pw_shell, "-", (char *) 0, env);
X57c62
X< execl("/bin/sh", "-", (char *) 0);
X---
X> execle("/bin/sh", "-", (char *) 0, env);
+ END-OF-FILE login.c.diff
chmod 'u=rw,g=r,o=r' 'login.c.diff'
set `wc -c 'login.c.diff'`
count=$1
case $count in
494) :;;
*) echo 'Bad character count in ''login.c.diff' >&2
echo 'Count should be 494' >&2
esac
echo Extracting 'lpr.c.diff'
sed 's/^X//' > 'lpr.c.diff' << '+ END-OF-FILE ''lpr.c.diff'
X3c3
X< #include "errno.h"
X---
X> #include <errno.h>
+ END-OF-FILE lpr.c.diff
chmod 'u=rw,g=r,o=r' 'lpr.c.diff'
set `wc -c 'lpr.c.diff'`
count=$1
case $count in
50) :;;
*) echo 'Bad character count in ''lpr.c.diff' >&2
echo 'Count should be 50' >&2
esac
echo Extracting 'ls.c.diff'
sed 's/^X//' > 'ls.c.diff' << '+ END-OF-FILE ''ls.c.diff'
X3,8c3,9
X< #include "../h/const.h"
X< #include "../h/type.h"
X< #include "stat.h"
X< #include "../fs/const.h"
X< #include "../fs/type.h"
X< #include "stdio.h"
X---
X> #include <stdio.h>
X> #include <sys/types.h>
X> #include <sys/stat.h>
X> #include <minix/const.h>
X> #include <minix/type.h>
X> #include <fs/const.h>
X> #include <fs/type.h>
X14c15
X< #define LEGAL 0x1E096DL /* legal flags to ls */
X---
X> #define LEGAL 0x0E0969L /* legal flags to ls */
X351c352
X< fprintf(stdout, "%2d, %2d ", (s>>8)&0377, s&0377);
X---
X> fprintf(stdout, "%3d, %3d ", (s>>8)&0377, s&0377);
+ END-OF-FILE ls.c.diff
chmod 'u=rw,g=r,o=r' 'ls.c.diff'
set `wc -c 'ls.c.diff'`
count=$1
case $count in
569) :;;
*) echo 'Bad character count in ''ls.c.diff' >&2
echo 'Count should be 569' >&2
esac
echo Extracting 'make.c.diff'
sed 's/^X//' > 'make.c.diff' << '+ END-OF-FILE ''make.c.diff'
X146,153c146
X< #ifdef BSD4.2
X< #include <sys/types.h>
X< #include <sys/stat.h>
X< #include <sys/wait.h>
X< #define WAIT union wait
X<
X< #else
X< /* sysV and MINIX and LATTICE */
X---
X> #ifdef LC
X167c160
X< /*
X---
X> #else
X170c163,168
X< */
X---
X> #endif
X>
X> #ifdef BSD4.2
X> #include <sys/wait.h>
X> #define WAIT union wait
X> #else
X228c226
X< done(0);
X---
X> exit(0);
X253c251
X< done( 0 );
X---
X> exit( 0 );
X983c981
X< done( -1 );
X---
X> exit( -1 );
X1861c1859
X< done( -1 );
X---
X> exit( -1 );
X1900c1898
X< done( -1 );
X---
X> exit( -1 );
X2239,2245d2236
X<
X< done(n)
X< int n;
X< {
X< _cleanup();
X< exit(n);
X< }
+ END-OF-FILE make.c.diff
chmod 'u=rw,g=r,o=r' 'make.c.diff'
set `wc -c 'make.c.diff'`
count=$1
case $count in
614) :;;
*) echo 'Bad character count in ''make.c.diff' >&2
echo 'Count should be 614' >&2
esac
echo Extracting 'mkdir.c.diff'
sed 's/^X//' > 'mkdir.c.diff' << '+ END-OF-FILE ''mkdir.c.diff'
X3c3
X< #include "signal.h"
X---
X> #include <signal.h>
+ END-OF-FILE mkdir.c.diff
chmod 'u=rw,g=r,o=r' 'mkdir.c.diff'
set `wc -c 'mkdir.c.diff'`
count=$1
case $count in
52) :;;
*) echo 'Bad character count in ''mkdir.c.diff' >&2
echo 'Count should be 52' >&2
esac
echo Extracting 'mkfs.c.diff'
sed 's/^X//' > 'mkfs.c.diff' << '+ END-OF-FILE ''mkfs.c.diff'
X16,18c16,18
X< #include "../h/const.h"
X< #include "../h/type.h"
X< #include "../fs/const.h"
X---
X> #include <minix/const.h>
X> #include <minix/type.h>
X> #include <fs/const.h>
X21,22c21,22
X< #include "../fs/type.h"
X< #include "../fs/super.h"
X---
X> #include <fs/type.h>
X> #include <fs/super.h>
X26,29c26
X< #define COMPILERFLAG
X< #endif
X<
X< #ifdef UNIX
X---
X> #else
X33,35d29
X< #undef major
X< #undef minor
X< #define COMPILERFLAG
X38,41d31
X< #ifndef COMPILERFLAG
X< #include "stdio.h"
X< #include "stat.h"
X< #endif
X43d32
X<
X45a35
X> #undef printf /* printf is a macro for printk */
X50,52d39
X< #ifdef UNIX
X< #undef printf /* printf is a macro for printk */
X< #endif
X55d41
X<
X74a61
X> int donttest; /* skip test if it fits on medium */
X83,86d69
X< char *size_fmt = "%6D";
X< char *ldfmt = "%6ld";
X< char *mode_fmt = "%6o";
X< char *ldmode = "%06o";
X88d70
X< /* MS-DOS and PC-IX use %ld for longs, MINIX uses %D */
X101,102c83
X< char *token[MAX_TOKENS], buf[BLOCK_SIZE];
X< int testb[2];
X---
X> char *token[MAX_TOKENS], line[LINE_LEN];
X124c105
X< write(2, "Usage: mkfs [-L] special proto\n", 31);
X---
X> write(2, "Usage: mkfs [-ldt] special proto\n", 33);
X131,140c112,121
X< case 'L' : print=1; break;
X< case 'l' : print=1;
X< size_fmt = ldfmt;
X< mode_fmt = ldmode;
X< break;
X< case 'o' :
X< case 'O' : override=1; break;
X< case 'd' : current_time = bin_time; dflag=1; break;
X< default :
X< printf ("Bad switch %c, ignored.\n",*argv[argc]);
X---
X> case 'l': case 'L':
X> print=1; break;
X> case 'o': case 'O':
X> override=1; break;
X> case 'd': case 'D':
X> current_time = bin_time; dflag=1; break;
X> case 't': case 'T':
X> donttest=1; break;
X> default:
X> printf ("Bad switch %c, ignored.\n",*argv[argc]);
X150c131
X< getline(buf, token); /* skip boot block info. */
X---
X> getline(line, token); /* skip boot block info. */
X153c134
X< getline(buf, token);
X---
X> getline(line, token);
X159c140
X< getline(buf, token);
X---
X> getline(line, token);
X189a171,173
X> if (!donttest) {
X> static short testb[BLOCK_SIZE/sizeof(short)];
X>
X201a186,190
X> lseek(fd, ((long)blocks - 1L) * BLOCK_SIZE, 0);
X> testb[0] = 0;
X> testb[1] = 0;
X> if (write(fd, testb, BLOCK_SIZE) != BLOCK_SIZE)
X> pexit("File system is too big for minor device");
X202a192
X> }
X351c341
X< int mode, n, usrid, grpid, z, major, minor, f;
X---
X> int mode, n, usrid, grpid, z, maj, min, f;
X382,384c372,376
X< major = atoi(token[4]);
X< minor = atoi(token[5]);
X< size = atoi(token[6]);
X---
X> maj = atoi(token[4]);
X> min = atoi(token[5]);
X> size = 0;
X> if (token[6])
X> size = atoi(token[6]);
X386c378
X< add_zone(n, (major<<8)|minor, size, current_time);
X---
X> add_zone(n, (maj<<8)|min, size, current_time);
X620c612
X< int buf[BLOCK_SIZE/sizeof(int)];
X---
X> short buf[BLOCK_SIZE/sizeof(short)];
X624,625c616,617
X< w = i / (8*sizeof(int));
X< s = i % (8*sizeof(int));
X---
X> w = i / (8*sizeof(short));
X> s = i % (8*sizeof(short));
X772c764
X< printf(mode_fmt, inode[i].i_mode);
X---
X> printf("%06o", inode[i].i_mode);
X775c767
X< printf(size_fmt, inode[i].i_size);
X---
X> printf("%6ld", inode[i].i_size);
+ END-OF-FILE mkfs.c.diff
chmod 'u=rw,g=r,o=r' 'mkfs.c.diff'
set `wc -c 'mkfs.c.diff'`
count=$1
case $count in
3212) :;;
*) echo 'Bad character count in ''mkfs.c.diff' >&2
echo 'Count should be 3212' >&2
esac
echo Extracting 'more.c.diff'
sed 's/^X//' > 'more.c.diff' << '+ END-OF-FILE ''more.c.diff'
X9,11c9,11
X< #define reverse() write(1, "\033z\160", 3) /* reverse video */
X< #define normal() write(1, "\033z\7", 3) /* undo reverse() */
X< #define clearln() write(1, "\r\033~0", 4) /* clear line */
X---
X> #define reverse() write(1, "\033[7m", 4) /* reverse video */
X> #define normal() write(1, "\033[m", 3) /* undo reverse() */
X> #define clearln() write(1, "\r\033[J", 4) /* clear line */
+ END-OF-FILE more.c.diff
chmod 'u=rw,g=r,o=r' 'more.c.diff'
set `wc -c 'more.c.diff'`
count=$1
case $count in
394) :;;
*) echo 'Bad character count in ''more.c.diff' >&2
echo 'Count should be 394' >&2
esac
echo Extracting 'mount.c.diff'
sed 's/^X//' > 'mount.c.diff' << '+ END-OF-FILE ''mount.c.diff'
X3c3,6
X< #include "errno.h"
X---
X> #include <errno.h>
X>
X> #define BUFSIZE 1024
X>
X4a8,9
X> char *mounttable = "/etc/mtab";
X> char buffer[BUFSIZE];
X9a15
X> int ro, fd;
X11,12c17
X< int ro;
X<
X---
X> if (argc == 1) list();
X27a33,55
X> if ((fd = open("/etc/mtab", 2)) < 0) exit(1);
X> lseek(fd, 0L, 2); /* seek to EOF */
X> write(fd, argv[1], strlen(argv[1]));
X> write(fd, " is mounted on ", 15);
X> write(fd, argv[2], strlen(argv[2]));
X> write(fd, "\n", 1);
X> exit(0);
X> }
X>
X>
X> list()
X> {
X> int fd, n;
X>
X> fd = open(mounttable, 0);
X> if (fd < 0) {
X> std_err("mount: cannot open ");
X> std_err(mounttable);
X> std_err("\n");
X> exit(1);
X> }
X> n = read(fd, buffer, BUFSIZE);
X> write(1, buffer, n);
+ END-OF-FILE mount.c.diff
chmod 'u=rw,g=r,o=r' 'mount.c.diff'
set `wc -c 'mount.c.diff'`
count=$1
case $count in
722) :;;
*) echo 'Bad character count in ''mount.c.diff' >&2
echo 'Count should be 722' >&2
esac
echo Extracting 'mv.c.diff'
sed 's/^X//' > 'mv.c.diff' << '+ END-OF-FILE ''mv.c.diff'
X6,7c6,8
X< #include "signal.h"
X< #include "stat.h"
X---
X> #include <signal.h>
X> #include <sys/types.h>
X> #include <sys/stat.h>
+ END-OF-FILE mv.c.diff
chmod 'u=rw,g=r,o=r' 'mv.c.diff'
set `wc -c 'mv.c.diff'`
count=$1
case $count in
125) :;;
*) echo 'Bad character count in ''mv.c.diff' >&2
echo 'Count should be 125' >&2
esac
exit 0