mirror of
https://github.com/ChronosX88/netsukuku.git
synced 2024-11-22 18:22:18 +00:00
The ntk-console client command console_uptime should now not print negative numbers, And inet_sendto should now properly print ipv4 addresses in a human readable format.
This commit is contained in:
parent
175f795a2b
commit
8bc5d69758
10
src/inet.c
10
src/inet.c
@ -1117,11 +1117,11 @@ inet_sendto(int s, const void *msg, size_t len, int flags,
|
|||||||
len-(len/2), flags, to, tolen);
|
len-(len/2), flags, to, tolen);
|
||||||
break;
|
break;
|
||||||
case EFAULT:
|
case EFAULT:
|
||||||
error("To Family is: %hu "
|
error("Bad Address\n"
|
||||||
"To Data is: %%pNP "
|
"To Family is: %hu "
|
||||||
"and: %s", to->sa_family,
|
"To Data is: %s",
|
||||||
to->sa_data,
|
to->sa_family,
|
||||||
strerror(errno));
|
inet_ntoa( &( ((struct sockaddr_in*)to)->sin_addr ) ));
|
||||||
default:
|
default:
|
||||||
error("inet_sendto: Cannot send(): %s", strerror(errno));
|
error("inet_sendto: Cannot send(): %s", strerror(errno));
|
||||||
return err;
|
return err;
|
||||||
|
@ -179,13 +179,13 @@ ntkd_request(command_t command)
|
|||||||
|
|
||||||
void console_uptime(void) {
|
void console_uptime(void) {
|
||||||
|
|
||||||
int uptime_sec1;
|
unsigned int uptime_sec1;
|
||||||
int uptime_min1;
|
unsigned int uptime_min1;
|
||||||
int uptime_hour1;
|
unsigned int uptime_hour1;
|
||||||
|
|
||||||
int uptime_day1;
|
unsigned int uptime_day1;
|
||||||
int uptime_month1;
|
unsigned int uptime_month1;
|
||||||
int uptime_year1;
|
unsigned int uptime_year1;
|
||||||
|
|
||||||
time(&rawtime);
|
time(&rawtime);
|
||||||
|
|
||||||
|
@ -31,12 +31,12 @@ int rc, bytesReceived;
|
|||||||
time_t rawtime;
|
time_t rawtime;
|
||||||
struct tm *timeinfo;
|
struct tm *timeinfo;
|
||||||
|
|
||||||
int uptime_sec;
|
unsigned int uptime_sec;
|
||||||
int uptime_min;
|
unsigned int uptime_min;
|
||||||
int uptime_hour;
|
unsigned int uptime_hour;
|
||||||
int uptime_day;
|
unsigned int uptime_day;
|
||||||
int uptime_month;
|
unsigned int uptime_month;
|
||||||
int uptime_year;
|
unsigned int uptime_year;
|
||||||
|
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user