[8349] in Athena Bugs

home help back first fref pref prev next nref lref last post

patch for /source/athena/athena.bin/turnin/clients/collect.c

daemon@ATHENA.MIT.EDU (brlewis@Athena.MIT.EDU)
Mon Oct 7 12:58:12 1991

From: brlewis@Athena.MIT.EDU
Date: Mon, 7 Oct 91 12:58:59 -0400
To: bugs@Athena.MIT.EDU

Dot (faculty liaison) suggested a change to make the error context for
collect be clearer to the average user.  Here's the patch:

*** collect.c~	Mon Oct  7 11:53:44 1991
--- collect.c	Mon Oct  7 11:57:11 1991
***************
*** 94,99 ****
--- 94,102 ----
    static char *old_author = NULL;
    struct stat buf;
  
+   (void) sprintf(f, "%s/%s", p->author, p->filename);
+   kbytes += ((p->size + 1023) >> 10);
+ 
    if (!old_author || strcmp(p->author, old_author)) {
      /******** deal with new student ********/
      if (verbose) {
***************
*** 103,110 ****
      if (!(flags & LISTONLY))
        if (mkdir(p->author, 0777))
  	if (errno != EEXIST) {
! 	  sprintf(fxmain_error_context, "while creating directory \"%s\"",
! 		  p->author);
  	  return ((long) errno);
  	} else {
  	  stat(p->author, &buf);
--- 106,112 ----
      if (!(flags & LISTONLY))
        if (mkdir(p->author, 0777))
  	if (errno != EEXIST) {
! 	  sprintf(fxmain_error_context, "(%s not collected)", f);
  	  return ((long) errno);
  	} else {
  	  stat(p->author, &buf);
***************
*** 114,130 ****
  	      printf("Using existing directory \"%s\".\n",
  		     p->author);
  	  } else {
! 	    sprintf(fxmain_error_context,
! 		    "(\"%s\"); Could not create directory.",
! 		    p->author);
  	    return((long) errno);
  	  }
  	}
      old_author = p->author;
    }
- 
-   (void) sprintf(f, "%s/%s", p->author, p->filename);
-   kbytes += ((p->size + 1023) >> 10);
  
    return(0L);
  }
--- 116,127 ----
  	      printf("Using existing directory \"%s\".\n",
  		     p->author);
  	  } else {
! 	    sprintf(fxmain_error_context, "(%s not collected)", f);
  	    return((long) errno);
  	  }
  	}
      old_author = p->author;
    }
  
    return(0L);
  }

home help back first fref pref prev next nref lref last post