1
0
mirror of https://github.com/UzixLS/picocom.git synced 2025-07-19 07:21:18 +03:00

Moved msec2tv() to fdio.c/h

This commit is contained in:
Nick Patavalis
2018-02-28 10:36:44 +02:00
parent dceef28776
commit 45a49c8bbe
4 changed files with 11 additions and 18 deletions

9
fdio.c
View File

@ -34,6 +34,15 @@
/**********************************************************************/
struct timeval *
msec2tv (struct timeval *tv, long ms)
{
tv->tv_sec = ms / 1000;
tv->tv_usec = (ms % 1000) * 1000;
return tv;
}
ssize_t
writen_ni(int fd, const void *buff, size_t n)
{

2
fdio.h
View File

@ -24,6 +24,8 @@
#ifndef FDIO_H
struct timeval *msec2tv (struct timeval *tv, long ms);
/* Write exactly "n" bytes from "buff" to "fd". Works with blocking
and non-blocking fds. Returns number of bytes written; if != "n",
sets errno. */

View File

@ -1385,15 +1385,6 @@ do_command (unsigned char c)
/**********************************************************************/
static struct timeval *
msec2tv (struct timeval *tv, long ms)
{
tv->tv_sec = ms / 1000;
tv->tv_usec = (ms % 1000) * 1000;
return tv;
}
/* loop-exit reason */
enum le_reason {
LE_CMD,

View File

@ -1199,15 +1199,6 @@ cond_comport_start(struct term_s *t)
return STATE(t)->can_comport;
}
static struct timeval *
msec2tv (struct timeval *tv, long ms)
{
tv->tv_sec = ms / 1000;
tv->tv_usec = (ms % 1000) * 1000;
return tv;
}
/* Wait (keep reading from the fd and processing commands) until the
condition is satisfied (that is, until "cond" returns non-zero), or
until the timeout expires. Returns a positive on success, zero if