- Timestamp:
- 07/11/2017 05:11:50 PM (7 years ago)
- Branches:
- master
- Children:
- 7af8be4
- Parents:
- 4aa78b2
- Location:
- libcio
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
libcio/close.c
r4aa78b2 r4a17aeb 74 74 chp->c_ioctl = 0; 75 75 chp->c_seek = 0; 76 chp->c_close = _badf d;76 chp->c_close = _badfc; 77 77 78 78 if (_fatmod) … … 115 115 116 116 for (fd = 0; fd < MAXCHAN; ++fd) 117 if (chantab[fd].c_close NE _badf d)117 if (chantab[fd].c_close NE _badfc) 118 118 close(fd); 119 119 -
libcio/clusmap.c
r4aa78b2 r4a17aeb 289 289 void FILEpr(FILE *fp) 290 290 { 291 int16_t (*arg)(), ft; 291 chclo arg; 292 int16_t ft; 292 293 int8_t *ds, *fsn, *fse; 293 294 struct fcb *fcp; … … 305 306 ft = 0; 306 307 307 if (arg EQ _nop er) {308 if (arg EQ _nopc) { 308 309 309 310 ds = ((struct devtabl *)chantab[fp->_unit].c_arg)->d_name; -
libcio/fsinit.c
r4aa78b2 r4a17aeb 39 39 /* 40 40 ============================================================================ 41 _badf d() -- set "bad fd" error41 _badfio() -- set "bad fd" error on I/O 42 42 ============================================================================ 43 43 */ 44 44 45 int16_t _badf d(void)45 int16_t _badfio(io_arg arg, int8_t *buff, int16_t len) 46 46 { 47 47 errno = EBADF; /* set bad fd code */ … … 51 51 /* 52 52 ============================================================================ 53 _ noper() -- null return with no error condition53 _badfc() -- set "bad fd" error on close 54 54 ============================================================================ 55 55 */ 56 56 57 int16_t _noper(void) 57 int16_t _badfc(io_arg arg) 58 { 59 errno = EBADF; /* set bad fd code */ 60 return(FAILURE); /* return with an error indication */ 61 } 62 63 /* 64 ============================================================================ 65 _nopo() -- null open with no error condition 66 ============================================================================ 67 */ 68 69 int16_t _nopo(int8_t *name, int16_t flag, int16_t mode, struct channel *chp, struct devtabl *dp) 70 { 71 return(SUCCESS); /* return with a non-error indication */ 72 } 73 74 /* 75 ============================================================================ 76 _nopc() -- null close with no error condition 77 ============================================================================ 78 */ 79 80 int16_t _nopc(io_arg arg) 58 81 { 59 82 return(SUCCESS); /* return with a non-error indication */ … … 70 93 */ 71 94 72 void InitCH(struct channel *cp, int8_t rdi, int8_t wri, int8_t ioi, int8_t ski, int16_t (*cfp)(), io_arg charg)95 void InitCH(struct channel *cp, int8_t rdi, int8_t wri, int8_t ioi, int8_t ski, chclo cfp, io_arg charg) 73 96 { 74 97 cp->c_read = rdi; … … 128 151 Stdbufs = Stdbuf[MAXDFILE-1]; 129 152 130 InitCH(&chantab[0], 2, 0, 1, 0, _nop er, (io_arg)CON_DEV ); /* 0 - stdin */131 InitCH(&chantab[1], 0, 2, 1, 0, _nop er, (io_arg)CON_DEV ); /* 1 - stdout */132 InitCH(&chantab[2], 0, 2, 1, 0, _nop er, (io_arg)CON_DEV ); /* 2 - stderr */153 InitCH(&chantab[0], 2, 0, 1, 0, _nopc, (io_arg)CON_DEV ); /* 0 - stdin */ 154 InitCH(&chantab[1], 0, 2, 1, 0, _nopc, (io_arg)CON_DEV ); /* 1 - stdout */ 155 InitCH(&chantab[2], 0, 2, 1, 0, _nopc, (io_arg)CON_DEV ); /* 2 - stderr */ 133 156 134 157 for (i = 3; i < MAXCHAN; i++) /* 3..MAXCHAN-1 - not preassigned */ 135 InitCH(&chantab[i], 0, 0, 0, 0, _badf d, (io_arg)0L );158 InitCH(&chantab[i], 0, 0, 0, 0, _badfc, (io_arg)0L ); 136 159 137 160 _bpbin = FALSE; /* BPB isn't in memory */ -
libcio/fsinit.x
r4aa78b2 r4a17aeb 37 37 */ 38 38 39 extern void InitCH(struct channel *cp, int8_t rdi, int8_t wri, int8_t ioi, int8_t ski, int16_t (*cfp)(), io_arg charg);39 extern void InitCH(struct channel *cp, int8_t rdi, int8_t wri, int8_t ioi, int8_t ski, chclo cfp, io_arg charg); 40 40 extern void InitFS(void); 41 41 extern void Init_CB(FILE *fp, int8_t unit, int8_t flags, int32_t *bufad, int16_t bufsize); 42 42 extern int16_t _badfd(void); 43 43 extern int16_t _noper(void); 44 45 extern int16_t _badfc(io_arg arg); 46 extern int16_t _badfio(io_arg arg, int8_t *buff, int16_t len); 47 extern int16_t _nopc(io_arg arg); 48 extern int16_t _nopo(int8_t *name, int16_t flag, int16_t mode, struct channel *chp, struct devtabl *dp); -
libcio/open.c
r4aa78b2 r4a17aeb 8 8 #include "ram.h" 9 9 10 static struct device condev = { 2, 2, 1, 0, _nop er};10 static struct device condev = { 2, 2, 1, 0, _nopo }; 11 11 static struct device filedev = { 1, 1, 0, 1, _fileop }; 12 12 … … 48 48 49 49 for (chp = chantab, fd = 0 ; fd < MAXCHAN ; ++chp, ++fd) 50 if (chp->c_close EQ _badf d)50 if (chp->c_close EQ _badfc) 51 51 goto fndchan; 52 52 … … 90 90 chp->c_ioctl = dev->d_ioctl; 91 91 chp->c_seek = dev->d_seek; 92 chp->c_close = _nop er;92 chp->c_close = _nopc; 93 93 94 94 if ((*dev->d_open)(name, flag, mode, chp, dp) < 0) { /* open */ 95 95 96 chp->c_close = _badf d; /* couldn't open for some reason */96 chp->c_close = _badfc; /* couldn't open for some reason */ 97 97 return(FAILURE); 98 98 } -
libcio/read.c
r4aa78b2 r4a17aeb 38 38 #include "ram.h" 39 39 40 static int16_t (*t_read[])( ) = {40 static int16_t (*t_read[])(io_arg arg, int8_t *buff, int16_t len) = { 41 41 42 _badf d,/* 0 - invalid type */42 _badfio, /* 0 - invalid type */ 43 43 _filerd, /* 1 - disk file read */ 44 44 _conin /* 2 - console read */ -
libcio/write.c
r4aa78b2 r4a17aeb 10 10 #include "ram.h" 11 11 12 static int16_t (*wr_tab[])() = { /* write routine dispatch table */ 13 14 _badfd, /* 0 - invalid entry */ 12 /* write routine dispatch table */ 13 14 static int16_t (*wr_tab[])(io_arg arg, int8_t *buff, int16_t len) = { 15 16 _badfio, /* 0 - invalid entry */ 15 17 _filewr, /* 1 - disk file */ 16 18 _conwr /* 2 - console device */
Note:
See TracChangeset
for help on using the changeset viewer.