diff options
| author | Toomas Soome <tsoome@me.com> | 2018-10-21 10:20:21 +0300 |
|---|---|---|
| committer | Toomas Soome <tsoome@me.com> | 2019-09-18 18:41:18 +0300 |
| commit | c97b1070adbc3ae2291128243229991dd705d2d6 (patch) | |
| tree | d4f6e7e71ec477c5b3ba1039aaac271d6d01668a | |
| parent | 203710accc1c9daa504cfe30bd32ec3e3ef13090 (diff) | |
| download | illumos-joyent-c97b1070adbc3ae2291128243229991dd705d2d6.tar.gz | |
11601 telmod: cast between incompatible function types
Reviewed by: Andrew Stormont <andyjstormont@gmail.com>
Reviewed by: Robert Mustacchi <rm@fingolfin.org>
Approved by: Dan McDonald <danmcd@joyent.com>
| -rw-r--r-- | usr/src/uts/common/io/telmod.c | 44 |
1 files changed, 24 insertions, 20 deletions
diff --git a/usr/src/uts/common/io/telmod.c b/usr/src/uts/common/io/telmod.c index 825ef99f59..721c34cb8b 100644 --- a/usr/src/uts/common/io/telmod.c +++ b/usr/src/uts/common/io/telmod.c @@ -125,10 +125,10 @@ _info(struct modinfo *modinfop) static int telmodopen(queue_t *, dev_t *, int, int, cred_t *); static int telmodclose(queue_t *, int, cred_t *); -static void telmodrput(queue_t *, mblk_t *); -static void telmodrsrv(queue_t *); -static void telmodwput(queue_t *, mblk_t *); -static void telmodwsrv(queue_t *); +static int telmodrput(queue_t *, mblk_t *); +static int telmodrsrv(queue_t *); +static int telmodwput(queue_t *, mblk_t *); +static int telmodwsrv(queue_t *); static int rcv_parse(queue_t *q, mblk_t *mp); static int snd_parse(queue_t *q, mblk_t *mp); static void telmod_timer(void *); @@ -145,8 +145,8 @@ static struct module_info telmodoinfo = { }; static struct qinit telmodrinit = { - (int (*)())telmodrput, - (int (*)())telmodrsrv, + telmodrput, + telmodrsrv, telmodopen, telmodclose, nulldev, @@ -155,8 +155,8 @@ static struct qinit telmodrinit = { }; static struct qinit telmodwinit = { - (int (*)())telmodwput, - (int (*)())telmodwsrv, + telmodwput, + telmodwsrv, NULL, NULL, nulldev, @@ -350,7 +350,7 @@ telmodclose(queue_t *q, int flag, cred_t *credp) * telnet protocol processing to M_DATA. Take notice of TLI messages * indicating connection tear-down, and change them into M_HANGUP's. */ -static void +static int telmodrput(queue_t *q, mblk_t *mp) { mblk_t *newmp; @@ -361,7 +361,7 @@ telmodrput(queue_t *q, mblk_t *mp) ((q->q_first) || ((tmip->flags & TEL_STOPPED) && !(tmip->flags & TEL_GETBLK)) || !canputnext(q))) { (void) putq(q, mp); - return; + return (0); } switch (mp->b_datap->db_type) { @@ -376,7 +376,7 @@ is_mdata: if (tmip->flags & TEL_GETBLK) { if ((newmp = allocb(sizeof (char), BPRI_MED)) == NULL) { recover(q, mp, msgdsize(mp)); - return; + return (0); } newmp->b_datap->db_type = M_CTL; newmp->b_wptr = newmp->b_rptr + 1; @@ -498,6 +498,7 @@ is_mdata: #endif freemsg(mp); } + return (0); } /* @@ -505,7 +506,7 @@ is_mdata: * Mostly we end up here because of M_DATA processing delayed due to flow * control or lack of memory. XXX.sparker: TLI primitives here? */ -static void +static int telmodrsrv(queue_t *q) { mblk_t *mp, *newmp; @@ -516,7 +517,7 @@ telmodrsrv(queue_t *q) if (((tmip->flags & TEL_STOPPED) && !(tmip->flags & TEL_GETBLK)) || !canputnext(q)) { (void) putbq(q, mp); - return; + return (0); } switch (mp->b_datap->db_type) { @@ -526,7 +527,7 @@ is_mdata: if ((newmp = allocb(sizeof (char), BPRI_MED)) == NULL) { recover(q, mp, msgdsize(mp)); - return; + return (0); } newmp->b_datap->db_type = M_CTL; newmp->b_wptr = newmp->b_rptr + 1; @@ -541,7 +542,7 @@ is_mdata: break; } if (!rcv_parse(q, mp)) { - return; + return (0); } break; @@ -630,6 +631,7 @@ is_mdata: freemsg(mp); } } + return (0); } /* @@ -645,7 +647,7 @@ is_mdata: * can be running either daemon<->TCP or application<->telmod. We must * carefully deal with this. */ -static void +static int telmodwput( queue_t *q, /* Pointer to the read queue */ mblk_t *mp) /* Pointer to current message block */ @@ -848,12 +850,13 @@ telmodwput( freemsg(mp); break; } + return (0); } /* * telmodwsrv - module write service procedure */ -static void +static int telmodwsrv(queue_t *q) { mblk_t *mp, *savemp; @@ -864,21 +867,21 @@ telmodwsrv(queue_t *q) if (!canputnext(q)) { ASSERT(mp->b_datap->db_type < QPCTL); (void) putbq(q, mp); - return; + return (0); } switch (mp->b_datap->db_type) { case M_DATA: if (tmip->flags & TEL_STOPPED) { (void) putbq(q, mp); - return; + return (0); } /* * Insert a null character if carraige return * is not followed by line feed */ if (!snd_parse(q, mp)) { - return; + return (0); } break; @@ -906,6 +909,7 @@ telmodwsrv(queue_t *q) } } + return (0); } /* |
