Skip to content

Commit 365dbbc

Browse files
committed
PATH_MAX include
1 parent c3d7c4e commit 365dbbc

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

Source/Device/Serial.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#ifndef _WIN32
2020
#include <sys/select.h>
2121
#include <sys/stat.h>
22+
#include <limits.h>
2223
#endif
2324

2425
#include "Serial.h"
@@ -345,12 +346,10 @@ namespace Device
345346
std::vector<std::string> dev_files = Util::Helper::getFilesInDirectory("/dev");
346347
for (const auto &name : dev_files)
347348
{
348-
bool is_serial = false;
349-
349+
// Check for common serial device patterns
350350
if (name.compare(0, 6, "ttyUSB") == 0 || name.compare(0, 6, "ttyACM") == 0 || name.compare(0, 4, "ttyS") == 0)
351351
{
352352
std::string device_path = "/dev/" + name;
353-
354353
struct stat st;
355354
if (stat(device_path.c_str(), &st) == 0 && S_ISCHR(st.st_mode))
356355
{

0 commit comments

Comments
 (0)