|
Packit |
15a96c |
/*
|
|
Packit |
15a96c |
* sysdep1_s.c system dependant routines.
|
|
Packit |
15a96c |
* sysdep1.c has a dependeny to function not needed
|
|
Packit |
15a96c |
* for runscript so put m_flush (the only needed sysdep
|
|
Packit |
15a96c |
* function by runscript) into a separate object.
|
|
Packit |
15a96c |
*
|
|
Packit |
15a96c |
* m_flush - flush
|
|
Packit |
15a96c |
*
|
|
Packit |
15a96c |
* If it's possible, Posix termios are preferred.
|
|
Packit |
15a96c |
*
|
|
Packit |
15a96c |
* This file is part of the minicom communications package,
|
|
Packit |
15a96c |
* Copyright 1991-1995 Miquel van Smoorenburg.
|
|
Packit |
15a96c |
*
|
|
Packit |
15a96c |
* This program is free software; you can redistribute it and/or
|
|
Packit |
15a96c |
* modify it under the terms of the GNU General Public License
|
|
Packit |
15a96c |
* as published by the Free Software Foundation; either version
|
|
Packit |
15a96c |
* 2 of the License, or (at your option) any later version.
|
|
Packit |
15a96c |
*
|
|
Packit |
15a96c |
* You should have received a copy of the GNU General Public License along
|
|
Packit |
15a96c |
* with this program; if not, write to the Free Software Foundation, Inc.,
|
|
Packit |
15a96c |
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
Packit |
15a96c |
*/
|
|
Packit |
15a96c |
#ifdef HAVE_CONFIG_H
|
|
Packit |
15a96c |
#include <config.h>
|
|
Packit |
15a96c |
#endif
|
|
Packit |
15a96c |
|
|
Packit |
15a96c |
#include "sysdep.h"
|
|
Packit |
15a96c |
#include "minicom.h"
|
|
Packit |
15a96c |
|
|
Packit |
15a96c |
#ifdef USE_SOCKET
|
|
Packit |
15a96c |
int portfd_is_socket;
|
|
Packit |
15a96c |
int portfd_is_connected;
|
|
Packit |
15a96c |
struct sockaddr_un portfd_sock_addr;
|
|
Packit |
15a96c |
#endif
|
|
Packit |
15a96c |
|
|
Packit |
15a96c |
/*
|
|
Packit |
15a96c |
* Flush the buffers
|
|
Packit |
15a96c |
*/
|
|
Packit |
15a96c |
void m_flush(int fd)
|
|
Packit |
15a96c |
{
|
|
Packit |
15a96c |
#ifdef USE_SOCKET
|
|
Packit |
15a96c |
if (portfd_is_socket)
|
|
Packit |
15a96c |
return;
|
|
Packit |
15a96c |
#endif
|
|
Packit |
15a96c |
/* Should I Posixify this, or not? */
|
|
Packit |
15a96c |
#ifdef TCFLSH
|
|
Packit |
15a96c |
ioctl(fd, TCFLSH, 2);
|
|
Packit |
15a96c |
#endif
|
|
Packit |
15a96c |
#ifdef TIOCFLUSH
|
|
Packit |
15a96c |
{
|
|
Packit |
15a96c |
int out = 0;
|
|
Packit |
15a96c |
ioctl(fd, TIOCFLUSH, &out;;
|
|
Packit |
15a96c |
}
|
|
Packit |
15a96c |
#endif
|
|
Packit |
15a96c |
}
|
|
Packit |
15a96c |
|