Added check for at least one valid port.

This commit is contained in:
Oliver Schmidt 2018-02-04 17:29:51 +01:00
parent 8d7fe0bd12
commit 21dbb3da3d
1 changed files with 7 additions and 0 deletions

View File

@ -10,6 +10,7 @@
#include <time.h>
#include <string.h>
#include <libserialport.h>
#include <stdlib.h>
#include <fcntl.h>
#include <dirent.h>
#include <sys/stat.h>
@ -161,6 +162,12 @@ int main(void)
sp_free_port_list(ports);
}
if (iValidPortCount == 0)
{
printf("Err: No valid port\n");
return EXIT_FAILURE;
}
// TODO: Add server shutdown
while (1)
{