Commit c1b70de2 authored by Gleb Pinigin's avatar Gleb Pinigin Committed by Felix Paul Kühne
Browse files

HTTPServer: use meaningful defines of error codes from errno.h


Signed-off-by: Felix Paul Kühne's avatarFelix Paul Kühne <fkuehne@videolan.org>
parent e76dafe0
......@@ -93,7 +93,7 @@
NSError *error = nil;
if (![self.httpServer start:&error]) {
if (error.code == 13) {
if (error.code == EACCES) {
APLog(@"Port forbidden by OS, trying another one");
[self.httpServer setPort:8888];
if(![self.httpServer start:&error])
......@@ -101,14 +101,14 @@
}
/* Address already in Use, take a random one */
if (error.code == 48) {
if (error.code == EADDRINUSE) {
APLog(@"Port already in use, trying another one");
[self.httpServer setPort:0];
if(![self.httpServer start:&error])
return true;
}
if (error.code != 0) {
if (error) {
APLog(@"Error starting HTTP Server: %@", error.localizedDescription);
[self.httpServer stop];
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment