[comp.os.minix] Minix-386: cpdir.c error

nall@sun8.scri.fsu.edu (John Nall) (11/08/90)

When installing Minix-386, /usr/src/commands/cpdir.c has a
compilation error.  This is trivial to fix, but since I had
the differences lying around, thought I may as well post them.

John Nall

---------------------------cut here---------------------------
#! /bin/sh
# This is a shell archive, meaning:
# 1. Remove everything above the #! /bin/sh line.
# 2. Save the resulting text in a file.
# 3. Execute the file with /bin/sh (not csh) to create the files:
#	cpdir.cdi
# This archive created: Thu Nov  8 10:35:31 1990
export PATH; PATH=/bin:$PATH
if test -f 'cpdir.cdi'
then
	echo shar: will not over-write existing file "'cpdir.cdi'"
else
cat << \SHAR_EOF > 'cpdir.cdi'
*** /user/usr/src/commands/cpdir.c	Thu Jun 28 22:14:02 1990
--- /usr/src/commands/cpdir.c	Thu Nov  8 10:18:43 1990
***************
*** 125,131 ****
  		if (stat(spath, &st) < 0)
  			fatal("can't get file status of %s", spath);
  		if ((st.st_mode & S_IFMT) != S_IFDIR && st.st_nlink > 1)
! 			if (cplink(st, spath, dpath) == 1) continue;
  		switch (st.st_mode & S_IFMT) {
  		    case S_IFDIR:
  			cpdir(&st, spath, dpath);
--- 125,131 ----
  		if (stat(spath, &st) < 0)
  			fatal("can't get file status of %s", spath);
  		if ((st.st_mode & S_IFMT) != S_IFDIR && st.st_nlink > 1)
! 			if (cplink(&st, spath, dpath) == 1) continue;
  		switch (st.st_mode & S_IFMT) {
  		    case S_IFDIR:
  			cpdir(&st, spath, dpath);
***************
*** 228,234 ****
  }
  
  cplink(st, spath, dpath)
! struct stat st;
  char *spath, *dpath;
  {
    /* Handle files that are links. Returns 0 if file must be copied.
--- 228,234 ----
  }
  
  cplink(st, spath, dpath)
! struct stat *st;
  char *spath, *dpath;
  {
    /* Handle files that are links. Returns 0 if file must be copied.
***************
*** 238,245 ****
  
    linkent = -1;
    for (i = 0; i < nlinks; i++) {
! 	if (links[i].dev == st.st_dev
! 	    && links[i].ino == st.st_ino)
  		linkent = i;
    }
    if (linkent >= 0) {		/* It's already in the link table *//* we
--- 238,245 ----
  
    linkent = -1;
    for (i = 0; i < nlinks; i++) {
! 	if (links[i].dev == st->st_dev
! 	    && links[i].ino == st->st_ino)
  		linkent = i;
    }
    if (linkent >= 0) {		/* It's already in the link table *//* we
***************
*** 252,259 ****
  	return(1);		/* Don't try to copy it */
    } else {			/* Make an entry in the link table */
  	if (nlinks >= MAXLINKS) fatal("Too many links at %s\n", dpath);
! 	links[nlinks].dev = st.st_dev;
! 	links[nlinks].ino = st.st_ino;
  	links[nlinks].path = malloc(strlen(dpath) + 1);
  	if (links[nlinks].path == NULL)
  		fatal("No more memory at %s\n", dpath);
--- 252,259 ----
  	return(1);		/* Don't try to copy it */
    } else {			/* Make an entry in the link table */
  	if (nlinks >= MAXLINKS) fatal("Too many links at %s\n", dpath);
! 	links[nlinks].dev = st->st_dev;
! 	links[nlinks].ino = st->st_ino;
  	links[nlinks].path = malloc(strlen(dpath) + 1);
  	if (links[nlinks].path == NULL)
  		fatal("No more memory at %s\n", dpath);
SHAR_EOF
fi # end of overwriting check
#	End of shell archive
exit 0
--
John W. Nall		| Supercomputation Computations Research Institute
nall@sun8.scri.fsu.edu  | Florida State University, Tallahassee, FL 32306
 "Real programmers can write assembly code in any language." - Larry Wall