repositories
/
deb_libcec.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
unused warning
[deb_libcec.git]
/
src
/
lib
/
platform
/
posix
/
serialport.cpp
diff --git
a/src/lib/platform/posix/serialport.cpp
b/src/lib/platform/posix/serialport.cpp
index 3764a1567f9673a26aedfaa0ba1192cfe4884145..1e0e364fc8eb2dd5a98738117bd44730b34c5f23 100644
(file)
--- a/
src/lib/platform/posix/serialport.cpp
+++ b/
src/lib/platform/posix/serialport.cpp
@@
-1,7
+1,7
@@
/*
* This file is part of the libCEC(R) library.
*
/*
* This file is part of the libCEC(R) library.
*
- * libCEC(R) is Copyright (C) 2011-201
2
Pulse-Eight Limited. All rights reserved.
+ * libCEC(R) is Copyright (C) 2011-201
3
Pulse-Eight Limited. All rights reserved.
* libCEC(R) is an original work, containing original code.
*
* libCEC(R) is a trademark of Pulse-Eight Limited.
* libCEC(R) is an original work, containing original code.
*
* libCEC(R) is a trademark of Pulse-Eight Limited.
@@
-30,12
+30,12
@@
* http://www.pulse-eight.net/
*/
* http://www.pulse-eight.net/
*/
-#include "
../os
.h"
+#include "
env
.h"
#include <stdio.h>
#include <fcntl.h>
#include <stdio.h>
#include <fcntl.h>
-#include "
..
/sockets/serialport.h"
-#include "
..
/util/baudrate.h"
-#include "
..
/posix/os-socket.h"
+#include "
lib/platform
/sockets/serialport.h"
+#include "
lib/platform
/util/baudrate.h"
+#include "
lib/platform
/posix/os-socket.h"
#if defined(__APPLE__) || defined(__FreeBSD__)
#ifndef XCASE
#if defined(__APPLE__) || defined(__FreeBSD__)
#ifndef XCASE
@@
-48,16
+48,21
@@
#define IUCLC 0
#endif
#else
#define IUCLC 0
#endif
#else
+#ifdef HAVE_LOCKDEV
#include <lockdev.h>
#endif
#include <lockdev.h>
#endif
+#endif
using namespace std;
using namespace PLATFORM;
inline bool RemoveLock(const char *strDeviceName)
{
using namespace std;
using namespace PLATFORM;
inline bool RemoveLock(const char *strDeviceName)
{
- #if !defined(__APPLE__) && !defined(__FreeBSD__)
+ #if !defined(__APPLE__) && !defined(__FreeBSD__)
&& defined(HAVE_LOCKDEV)
return dev_unlock(strDeviceName, 0) == 0;
return dev_unlock(strDeviceName, 0) == 0;
+ #else
+ (void)strDeviceName; // silence unused warning
+ return true;
#endif
}
#endif
}
@@
-92,7
+97,7
@@
ssize_t CSerialSocket::Read(void* data, size_t len, uint64_t iTimeoutMs /* = 0 *
//setting all this stuff up is a pain in the ass
bool CSerialSocket::Open(uint64_t iTimeoutMs /* = 0 */)
{
//setting all this stuff up is a pain in the ass
bool CSerialSocket::Open(uint64_t iTimeoutMs /* = 0 */)
{
- iTimeoutMs = 0;
+ iTimeoutMs = 0;
if (!iTimeoutMs){} // silence unused warning
if (IsOpen())
{
m_iError = EINVAL;
if (IsOpen())
{
m_iError = EINVAL;
@@
-121,7
+126,7
@@
bool CSerialSocket::Open(uint64_t iTimeoutMs /* = 0 */)
return false;
}
return false;
}
- #if !defined(__APPLE__) && !defined(__FreeBSD__)
+ #if !defined(__APPLE__) && !defined(__FreeBSD__)
&& defined(HAVE_LOCKDEV)
if (dev_lock(m_strName.c_str()) != 0)
{
m_strError = "Couldn't lock the serial port";
if (dev_lock(m_strName.c_str()) != 0)
{
m_strError = "Couldn't lock the serial port";