Skip to content

Commit

Permalink
fix sem_open() call to be compliant
Browse files Browse the repository at this point in the history
Signed-off-by: Rohan Mars <[email protected]>
  • Loading branch information
rohanmars committed Nov 13, 2015
1 parent 4512ed5 commit 41eff6b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions src/test/librados/aio.cc
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class AioTestData
std::string init()
{
int ret;
if (SEM_FAILED == (m_sem = sem_open("test_aio_sem", O_CREAT, 0644, 0))) {
if (SEM_FAILED == (m_sem = sem_open("/test_aio_sem", O_CREAT, 0644, 0))) {
int err = errno;
ostringstream oss;
oss << "sem_open failed: " << cpp_strerror(err);
Expand Down Expand Up @@ -98,7 +98,7 @@ class AioTestDataPP
std::string init()
{
int ret;
if (SEM_FAILED == (m_sem = sem_open("test_aio_sem", O_CREAT, 0644, 0))) {
if (SEM_FAILED == (m_sem = sem_open("/test_aio_sem", O_CREAT, 0644, 0))) {
int err = errno;
ostringstream oss;
oss << "sem_open failed: " << cpp_strerror(err);
Expand Down Expand Up @@ -1755,7 +1755,7 @@ class AioTestDataEC
std::string init()
{
int ret;
if (SEM_FAILED == (m_sem = sem_open("test_aio_sem", O_CREAT, 0644, 0))) {
if (SEM_FAILED == (m_sem = sem_open("/test_aio_sem", O_CREAT, 0644, 0))) {
int err = errno;
ostringstream oss;
oss << "sem_open failed: " << cpp_strerror(err);
Expand Down Expand Up @@ -1812,7 +1812,7 @@ class AioTestDataECPP
std::string init()
{
int ret;
if (SEM_FAILED == (m_sem = sem_open("test_aio_sem", O_CREAT, 0644, 0))) {
if (SEM_FAILED == (m_sem = sem_open("/test_aio_sem", O_CREAT, 0644, 0))) {
int err = errno;
ostringstream oss;
oss << "sem_open failed: " << cpp_strerror(err);
Expand Down
12 changes: 6 additions & 6 deletions src/test/librados/watch_notify.cc
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ class WatchNotifyTestCtx2 : public WatchCtx2
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"

TEST_F(LibRadosWatchNotify, WatchNotify) {
ASSERT_NE(SEM_FAILED, (sem = sem_open("test_watch_notify_sem", O_CREAT, 0644, 0)));
ASSERT_NE(SEM_FAILED, (sem = sem_open("/test_watch_notify_sem", O_CREAT, 0644, 0)));
char buf[128];
memset(buf, 0xcc, sizeof(buf));
ASSERT_EQ(0, rados_write(ioctx, "foo", buf, sizeof(buf), 0));
Expand All @@ -124,7 +124,7 @@ TEST_F(LibRadosWatchNotify, WatchNotify) {
}

TEST_P(LibRadosWatchNotifyPP, WatchNotify) {
ASSERT_NE(SEM_FAILED, (sem = sem_open("test_watch_notify_sem", O_CREAT, 0644, 0)));
ASSERT_NE(SEM_FAILED, (sem = sem_open("/test_watch_notify_sem", O_CREAT, 0644, 0)));
char buf[128];
memset(buf, 0xcc, sizeof(buf));
bufferlist bl1;
Expand All @@ -145,7 +145,7 @@ TEST_P(LibRadosWatchNotifyPP, WatchNotify) {
}

TEST_F(LibRadosWatchNotifyEC, WatchNotify) {
ASSERT_NE(SEM_FAILED, (sem = sem_open("test_watch_notify_sem", O_CREAT, 0644, 0)));
ASSERT_NE(SEM_FAILED, (sem = sem_open("/test_watch_notify_sem", O_CREAT, 0644, 0)));
char buf[128];
memset(buf, 0xcc, sizeof(buf));
ASSERT_EQ(0, rados_write(ioctx, "foo", buf, sizeof(buf), 0));
Expand All @@ -160,7 +160,7 @@ TEST_F(LibRadosWatchNotifyEC, WatchNotify) {
}

TEST_F(LibRadosWatchNotifyECPP, WatchNotify) {
ASSERT_NE(SEM_FAILED, (sem = sem_open("test_watch_notify_sem", O_CREAT, 0644, 0)));
ASSERT_NE(SEM_FAILED, (sem = sem_open("/test_watch_notify_sem", O_CREAT, 0644, 0)));
char buf[128];
memset(buf, 0xcc, sizeof(buf));
bufferlist bl1;
Expand All @@ -183,7 +183,7 @@ TEST_F(LibRadosWatchNotifyECPP, WatchNotify) {
// --

TEST_P(LibRadosWatchNotifyPP, WatchNotifyTimeout) {
ASSERT_NE(SEM_FAILED, (sem = sem_open("test_watch_notify_sem", O_CREAT, 0644, 0)));
ASSERT_NE(SEM_FAILED, (sem = sem_open("/test_watch_notify_sem", O_CREAT, 0644, 0)));
ioctx.set_notify_timeout(1);
uint64_t handle;
WatchNotifyTestCtx ctx;
Expand All @@ -200,7 +200,7 @@ TEST_P(LibRadosWatchNotifyPP, WatchNotifyTimeout) {
}

TEST_F(LibRadosWatchNotifyECPP, WatchNotifyTimeout) {
ASSERT_NE(SEM_FAILED, (sem = sem_open("test_watch_notify_sem", O_CREAT, 0644, 0)));
ASSERT_NE(SEM_FAILED, (sem = sem_open("/test_watch_notify_sem", O_CREAT, 0644, 0)));
ioctx.set_notify_timeout(1);
uint64_t handle;
WatchNotifyTestCtx ctx;
Expand Down

0 comments on commit 41eff6b

Please sign in to comment.