home *** CD-ROM | disk | FTP | other *** search
/ C!T ROM 2 / ctrom_ii_b.zip / ctrom_ii_b / PROGRAM / C / SMALL_C / FCLOSE.C < prev    next >
Text File  |  1987-10-04  |  512b  |  19 lines

  1. #define NOCCARGC  /* no argument count passing */
  2. #include stdio.h
  3. #include clib.def
  4. /*
  5. ** Close fd 
  6. ** Entry: fd = File descriptor for file to be closed.
  7. ** Returns NULL for success, otherwise ERR
  8. */
  9. extern int Ustatus[], Udevice[], Ufd[];
  10. fclose(fd) int fd; {
  11.   if(!Umode(fd)) return (ERR);
  12.   if(!isatty(fd)) {
  13.     if(Umsdos(0,0,Ufd[fd],CLOFIL)==ERR)
  14.       return (ERR);
  15.     }
  16.   return (Ustatus[fd]=Udevice[fd]=NULL);
  17.   }
  18.  
  19.