A couple things that got tangled up in my tree, easier to check in both than

untangle them:

Rewrite u_signal_names() into get_signum() and get_signame(), plus trim the
signal list to that required by posix (they can specify the numbers for
the rest if they really need them).  (This is preparatory cleanup for adding
a timeout applet like Roberto Foglietta wants.)

Export the itoa (added due to Denis Vlasenko, although it's not quite his
preferred implementation) from xfuncs.c so it's actually used, and remove
several other redundant implementations of itoa and utoa() in the tree.
This commit is contained in:
Rob Landley
2006-07-12 19:17:55 +00:00
parent 801ab14013
commit c9c1a41c58
10 changed files with 102 additions and 339 deletions

View File

@@ -548,7 +548,7 @@ static int
wait_for_reply(int sock, struct sockaddr_in *fromp, const struct timeval *tp)
{
fd_set fds;
struct timeval now, wait;
struct timeval now, tvwait;
struct timezone tz;
int cc = 0;
socklen_t fromlen = sizeof(*fromp);
@@ -556,12 +556,12 @@ wait_for_reply(int sock, struct sockaddr_in *fromp, const struct timeval *tp)
FD_ZERO(&fds);
FD_SET(sock, &fds);
wait.tv_sec = tp->tv_sec + waittime;
wait.tv_usec = tp->tv_usec;
tvwait.tv_sec = tp->tv_sec + waittime;
tvwait.tv_usec = tp->tv_usec;
(void)gettimeofday(&now, &tz);
tvsub(&wait, &now);
tvsub(&tvwait, &now);
if (select(sock + 1, &fds, NULL, NULL, &wait) > 0)
if (select(sock + 1, &fds, NULL, NULL, &tvwait) > 0)
cc = recvfrom(sock, (char *)packet, sizeof(packet), 0,
(struct sockaddr *)fromp, &fromlen);