Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
814bbc46
Commit
814bbc46
authored
Nov 23, 2010
by
Borut Razem
Committed by
Alexandre Julliard
Nov 24, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ping: Sleep 1 second less.
parent
33423f37
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
7 deletions
+15
-7
ping_main.c
programs/ping/ping_main.c
+15
-7
No files found.
programs/ping/ping_main.c
View file @
814bbc46
...
@@ -18,6 +18,7 @@
...
@@ -18,6 +18,7 @@
*/
*/
#include <unistd.h>
#include <unistd.h>
#include <stdio.h>
#include <windows.h>
#include <windows.h>
#include "wine/debug.h"
#include "wine/debug.h"
...
@@ -26,15 +27,15 @@ WINE_DEFAULT_DEBUG_CHANNEL(ping);
...
@@ -26,15 +27,15 @@ WINE_DEFAULT_DEBUG_CHANNEL(ping);
static
void
usage
(
void
)
static
void
usage
(
void
)
{
{
WINE_MESSAGE
(
"Usage: ping [-n count] [-w timeout] target_name
\n\n
"
);
printf
(
"Usage: ping [-n count] [-w timeout] target_name
\n\n
"
WINE_MESSAGE
(
"Options:
\n
"
);
"Options:
\n
"
WINE_MESSAGE
(
" -n Number of echo requests to send.
\n
"
);
" -n Number of echo requests to send.
\n
"
WINE_MESSAGE
(
" -w Timeout in milliseconds to wait for each reply.
\n
"
);
" -w Timeout in milliseconds to wait for each reply.
\n
"
);
}
}
int
main
(
int
argc
,
char
**
argv
)
int
main
(
int
argc
,
char
**
argv
)
{
{
int
n
=
0
;
unsigned
int
n
=
0
;
int
optc
;
int
optc
;
WINE_FIXME
(
"this command currently just sleeps based on -n parameter
\n
"
);
WINE_FIXME
(
"this command currently just sleeps based on -n parameter
\n
"
);
...
@@ -44,7 +45,12 @@ int main(int argc, char** argv)
...
@@ -44,7 +45,12 @@ int main(int argc, char** argv)
switch
(
optc
)
switch
(
optc
)
{
{
case
'n'
:
case
'n'
:
n
=
atoi
(
optarg
);
n
=
atoi
(
optarg
);
if
(
n
==
0
)
{
printf
(
"Bad value for option -n, valid range is from 1 to 4294967295.
\n
"
);
exit
(
1
);
}
break
;
break
;
case
'?'
:
case
'?'
:
usage
();
usage
();
...
@@ -56,6 +62,8 @@ int main(int argc, char** argv)
...
@@ -56,6 +62,8 @@ int main(int argc, char** argv)
}
}
}
}
Sleep
(
n
*
1000
);
if
(
n
!=
0
)
Sleep
((
n
-
1
)
*
1000
);
return
0
;
return
0
;
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment