mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-01 12:19:28 +00:00
Correct the ``ignoring sync/async'' warnings so that they show
up with the correct device type. Reassign the correct tcpdevice or execdevice after transfering a link in MP server mode.
This commit is contained in:
parent
497760a16a
commit
acbd1f00fd
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=47461
@ -23,7 +23,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: exec.c,v 1.1 1999/05/08 11:06:30 brian Exp $
|
||||
* $Id: exec.c,v 1.2 1999/05/12 09:48:49 brian Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -97,8 +97,10 @@ struct device *
|
||||
exec_iov2device(int type, struct physical *p, struct iovec *iov,
|
||||
int *niov, int maxiov)
|
||||
{
|
||||
if (type == EXEC_DEVICE)
|
||||
if (type == EXEC_DEVICE) {
|
||||
physical_SetupStack(p, execdevice.name, PHYSICAL_FORCE_ASYNC);
|
||||
return &execdevice;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
@ -162,7 +164,7 @@ exec_Create(struct physical *p)
|
||||
p->fd = fids[0];
|
||||
waitpid(pid, &stat, 0);
|
||||
log_Printf(LogDEBUG, "Using descriptor %d for child\n", p->fd);
|
||||
physical_SetupStack(p, PHYSICAL_FORCE_ASYNC);
|
||||
physical_SetupStack(p, execdevice.name, PHYSICAL_FORCE_ASYNC);
|
||||
return &execdevice;
|
||||
}
|
||||
}
|
||||
|
@ -16,7 +16,7 @@
|
||||
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
* $Id: physical.c,v 1.12 1999/05/13 19:29:40 brian Exp $
|
||||
* $Id: physical.c,v 1.13 1999/05/18 01:37:46 brian Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
@ -571,7 +571,7 @@ iov2physical(struct datalink *dl, struct iovec *iov, int *niov, int maxiov,
|
||||
p->handler = (*devices[h].iov2device)(type, p, iov, niov, maxiov);
|
||||
|
||||
if (p->handler == NULL)
|
||||
physical_SetupStack(p, PHYSICAL_NOFORCE);
|
||||
physical_SetupStack(p, "unknown", PHYSICAL_NOFORCE);
|
||||
|
||||
return p;
|
||||
}
|
||||
@ -855,7 +855,7 @@ physical_Open(struct physical *p, struct bundle *bundle)
|
||||
p->handler = (*devices[h].create)(p);
|
||||
if (p->fd >= 0) {
|
||||
if (p->handler == NULL) {
|
||||
physical_SetupStack(p, PHYSICAL_NOFORCE);
|
||||
physical_SetupStack(p, "unknown", PHYSICAL_NOFORCE);
|
||||
log_Printf(LogDEBUG, "%s: stdin is unidentified\n", p->link.name);
|
||||
}
|
||||
physical_Found(p);
|
||||
@ -893,7 +893,7 @@ physical_Open(struct physical *p, struct bundle *bundle)
|
||||
}
|
||||
|
||||
void
|
||||
physical_SetupStack(struct physical *p, int how)
|
||||
physical_SetupStack(struct physical *p, const char *who, int how)
|
||||
{
|
||||
link_EmptyStack(&p->link);
|
||||
if (how == PHYSICAL_FORCE_SYNC ||
|
||||
@ -912,12 +912,11 @@ physical_SetupStack(struct physical *p, int how)
|
||||
link_Stack(&p->link, &aliaslayer);
|
||||
#endif
|
||||
if (how == PHYSICAL_FORCE_ASYNC && physical_IsSync(p)) {
|
||||
log_Printf(LogWARN, "Sync device setting ignored for ``%s'' device\n",
|
||||
p->handler ? p->handler->name : "unknown");
|
||||
log_Printf(LogWARN, "Sync device setting ignored for ``%s'' device\n", who);
|
||||
p->cfg.speed = MODEM_SPEED;
|
||||
} else if (how == PHYSICAL_FORCE_SYNC && !physical_IsSync(p)) {
|
||||
log_Printf(LogWARN, "Async device setting ignored for ``%s'' device\n",
|
||||
p->handler ? p->handler->name : "unknown");
|
||||
who);
|
||||
physical_SetSync(p);
|
||||
}
|
||||
}
|
||||
|
@ -16,7 +16,7 @@
|
||||
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
* $Id: physical.h,v 1.9 1999/05/08 11:07:24 brian Exp $
|
||||
* $Id: physical.h,v 1.10 1999/05/12 09:48:58 brian Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
@ -134,5 +134,5 @@ extern int physical_RemoveFromSet(struct physical *, fd_set *, fd_set *,
|
||||
fd_set *);
|
||||
extern int physical_SetMode(struct physical *, int);
|
||||
extern void physical_DeleteQueue(struct physical *);
|
||||
extern void physical_SetupStack(struct physical *, int);
|
||||
extern void physical_SetupStack(struct physical *, const char *, int);
|
||||
extern void physical_StopDeviceTimer(struct physical *);
|
||||
|
@ -23,7 +23,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: tcp.c,v 1.1 1999/05/08 11:07:45 brian Exp $
|
||||
* $Id: tcp.c,v 1.2 1999/05/12 09:49:04 brian Exp $
|
||||
*/
|
||||
|
||||
#include <sys/types.h>
|
||||
@ -115,8 +115,10 @@ struct device *
|
||||
tcp_iov2device(int type, struct physical *p, struct iovec *iov,
|
||||
int *niov, int maxiov)
|
||||
{
|
||||
if (type == TCP_DEVICE)
|
||||
if (type == TCP_DEVICE) {
|
||||
physical_SetupStack(p, tcpdevice.name, PHYSICAL_FORCE_ASYNC);
|
||||
return &tcpdevice;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
@ -179,7 +181,7 @@ tcp_Create(struct physical *p)
|
||||
inet_ntoa(sock.sin_addr), ntohs(sock.sin_port));
|
||||
p->name.base = p->name.full;
|
||||
}
|
||||
physical_SetupStack(p, PHYSICAL_FORCE_ASYNC);
|
||||
physical_SetupStack(p, tcpdevice.name, PHYSICAL_FORCE_ASYNC);
|
||||
return &tcpdevice;
|
||||
}
|
||||
}
|
||||
|
@ -23,7 +23,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: tty.c,v 1.5 1999/05/16 11:58:48 brian Exp $
|
||||
* $Id: tty.c,v 1.6 1999/05/18 01:37:46 brian Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -324,15 +324,12 @@ tty_iov2device(int type, struct physical *p, struct iovec *iov, int *niov,
|
||||
int maxiov)
|
||||
{
|
||||
if (type == TTY_DEVICE) {
|
||||
struct ttydevice *dev;
|
||||
struct ttydevice *dev = (struct ttydevice *)iov[(*niov)++].iov_base;
|
||||
|
||||
/* It's one of ours ! Let's create the device */
|
||||
|
||||
dev = (struct ttydevice *)iov[(*niov)++].iov_base;
|
||||
/* Refresh function pointers etc */
|
||||
memcpy(&dev->dev, &basettydevice, sizeof dev->dev);
|
||||
|
||||
physical_SetupStack(p, PHYSICAL_NOFORCE);
|
||||
physical_SetupStack(p, dev->dev.name, PHYSICAL_NOFORCE);
|
||||
if (dev->Timer.state != TIMER_STOPPED) {
|
||||
dev->Timer.state = TIMER_STOPPED;
|
||||
tty_StartTimer(p);
|
||||
@ -432,7 +429,7 @@ tty_Create(struct physical *p)
|
||||
} else
|
||||
fcntl(p->fd, F_SETFL, oldflag & ~O_NONBLOCK);
|
||||
|
||||
physical_SetupStack(p, PHYSICAL_NOFORCE);
|
||||
physical_SetupStack(p, dev->dev.name, PHYSICAL_NOFORCE);
|
||||
|
||||
return &dev->dev;
|
||||
}
|
||||
|
@ -23,7 +23,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: tcp.c,v 1.1 1999/05/08 11:07:45 brian Exp $
|
||||
* $Id: udp.c,v 1.1 1999/05/12 09:49:09 brian Exp $
|
||||
*/
|
||||
|
||||
#include <sys/types.h>
|
||||
@ -135,21 +135,17 @@ struct device *
|
||||
udp_iov2device(int type, struct physical *p, struct iovec *iov, int *niov,
|
||||
int maxiov)
|
||||
{
|
||||
struct device *dev;
|
||||
|
||||
if (type == UDP_DEVICE) {
|
||||
/* It's one of ours ! Let's create the device */
|
||||
struct udpdevice *dev = (struct udpdevice *)iov[(*niov)++].iov_base;
|
||||
|
||||
dev = (struct device *)iov[(*niov)++].iov_base;
|
||||
/* Refresh function pointers etc */
|
||||
memcpy(dev, &baseudpdevice, sizeof *dev);
|
||||
/* Remember, there's really more than (sizeof *dev) there */
|
||||
memcpy(&dev->dev, &baseudpdevice, sizeof dev->dev);
|
||||
|
||||
physical_SetupStack(p, PHYSICAL_FORCE_SYNC);
|
||||
} else
|
||||
dev = NULL;
|
||||
physical_SetupStack(p, dev->dev.name, PHYSICAL_FORCE_SYNC);
|
||||
return &dev->dev;
|
||||
}
|
||||
|
||||
return dev;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static struct udpdevice *
|
||||
@ -261,7 +257,7 @@ udp_Create(struct physical *p)
|
||||
|
||||
if (dev) {
|
||||
memcpy(&dev->dev, &baseudpdevice, sizeof dev->dev);
|
||||
physical_SetupStack(p, PHYSICAL_FORCE_SYNC);
|
||||
physical_SetupStack(p, dev->dev.name, PHYSICAL_FORCE_SYNC);
|
||||
return &dev->dev;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user