mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 01:27:42 +00:00
LibC+ping: Let's use the traditional timersub() et al prototypes
This also fixes the build, since ping.cpp already had a timersub().
This commit is contained in:
parent
71922ee6a5
commit
2cbc3c6ee5
2 changed files with 16 additions and 26 deletions
|
@ -24,16 +24,6 @@ uint16_t internet_checksum(const void* ptr, size_t count)
|
|||
return htons(~checksum);
|
||||
}
|
||||
|
||||
inline void timersub(struct timeval* a, struct timeval* b, struct timeval* result)
|
||||
{
|
||||
result->tv_sec = a->tv_sec - b->tv_sec;
|
||||
result->tv_usec = a->tv_usec - b->tv_usec;
|
||||
if (result->tv_usec < 0) {
|
||||
--result->tv_sec;
|
||||
result->tv_usec += 1000000;
|
||||
}
|
||||
}
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
if (argc != 2) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue