diff options
author | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2022-06-01 16:15:08 +0300 |
---|---|---|
committer | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2022-06-01 22:12:37 +0300 |
commit | 93dcf8ea912ceb2eb83b73a7e5165a08c4db9312 (patch) | |
tree | fa6d756e8a65120a715a17621d6ed3244c14b215 /src/examples/suspend_resume_epoll.c | |
parent | 74c2eba238ff26788eae3afac68307f49a82099b (diff) | |
download | libmicrohttpd-93dcf8ea912ceb2eb83b73a7e5165a08c4db9312.tar.gz libmicrohttpd-93dcf8ea912ceb2eb83b73a7e5165a08c4db9312.zip |
src/examples: muted compiler warnings
Diffstat (limited to 'src/examples/suspend_resume_epoll.c')
-rw-r--r-- | src/examples/suspend_resume_epoll.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/examples/suspend_resume_epoll.c b/src/examples/suspend_resume_epoll.c index 87ec6521..c85d9b7c 100644 --- a/src/examples/suspend_resume_epoll.c +++ b/src/examples/suspend_resume_epoll.c | |||
@@ -145,14 +145,22 @@ main (int argc, | |||
145 | struct epoll_event events_list[1]; | 145 | struct epoll_event events_list[1]; |
146 | struct Request *req; | 146 | struct Request *req; |
147 | uint64_t timer_expirations; | 147 | uint64_t timer_expirations; |
148 | int port; | ||
148 | 149 | ||
149 | if (argc != 2) | 150 | if (argc != 2) |
150 | { | 151 | { |
151 | printf ("%s PORT\n", argv[0]); | 152 | printf ("%s PORT\n", argv[0]); |
152 | return 1; | 153 | return 1; |
153 | } | 154 | } |
155 | port = atoi (argv[1]); | ||
156 | if ( (1 > port) || (port > 65535) ) | ||
157 | { | ||
158 | fprintf (stderr, | ||
159 | "Port must be a number between 1 and 65535.\n"); | ||
160 | return 1; | ||
161 | } | ||
154 | d = MHD_start_daemon (MHD_USE_EPOLL | MHD_ALLOW_SUSPEND_RESUME, | 162 | d = MHD_start_daemon (MHD_USE_EPOLL | MHD_ALLOW_SUSPEND_RESUME, |
155 | atoi (argv[1]), | 163 | (uint16_t) port, |
156 | NULL, NULL, &ahc_echo, NULL, | 164 | NULL, NULL, &ahc_echo, NULL, |
157 | MHD_OPTION_NOTIFY_COMPLETED, &connection_done, NULL, | 165 | MHD_OPTION_NOTIFY_COMPLETED, &connection_done, NULL, |
158 | MHD_OPTION_END); | 166 | MHD_OPTION_END); |