Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
proview
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Esteban Blanc
proview
Commits
4a481a43
Commit
4a481a43
authored
Jul 20, 2006
by
claes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Try with smaller queue if mq_open returns EINVAL
parent
1f8962c2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
13 deletions
+21
-13
src/lib/rt/src/os_linux/rt_errl.c
src/lib/rt/src/os_linux/rt_errl.c
+21
-13
No files found.
src/lib/rt/src/os_linux/rt_errl.c
View file @
4a481a43
/*
* Proview $Id: rt_errl.c,v 1.
7 2006-01-31 08:31:01
claes Exp $
* Proview $Id: rt_errl.c,v 1.
8 2006-07-20 10:23:52
claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
...
...
@@ -28,11 +28,13 @@
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#if defined _POSIX_MESSAGE_PASSING
//
#if defined _POSIX_MESSAGE_PASSING
# include <mqueue.h>
#else
# include "rt_mq.h"
#endif
//#else
//# include "rt_mq.h"
//#endif
#include <mqueue.h>
#include <limits.h>
#include <pthread.h>
#include <sys/time.h>
...
...
@@ -40,11 +42,8 @@
#include "rt_errl.h"
#include "rt_errh.h"
#if defined _POSIX_MESSAGE_PASSING
# define MAX_NO_MSG 10;
#else
# define MAX_NO_MSG 100;
#endif
#define MAX_NO_MSG 100;
#define DEF_MAX_NO_MSG 10;
static
pthread_mutex_t
fileMutex
;
static
pthread_mutex_t
termMutex
;
...
...
@@ -106,15 +105,24 @@ errl_Init (
mqattr
.
mq_msgsize
=
LOG_MAX_MSG_SIZE
;
/* max mess size */
mqattr
.
mq_maxmsg
=
MAX_NO_MSG
;
/* max no of msg in this queue */
mqattr
.
mq_flags
=
0
;
/* not used entry */
mqattr
.
mq_flags
=
0
;
// O_NONBLOCK;
oflags
=
O_CREAT
|
O_RDWR
;
mode
=
S_IRUSR
|
S_IWUSR
|
S_IRGRP
|
S_IWGRP
|
S_IROTH
|
S_IWOTH
;
sprintf
(
name
,
"%s_%s"
,
LOG_QUEUE_NAME
,
busid
?
busid
:
""
);
mqid
=
mq_open
(
name
,
oflags
,
mode
,
&
mqattr
);
if
(
mqid
==
(
mqd_t
)
-
1
)
{
perror
(
"rt_logmod: mq_open "
);
return
;
if
(
errno
==
EINVAL
)
{
mqattr
.
mq_maxmsg
=
DEF_MAX_NO_MSG
;
/* Try with smaller queue */
mqid
=
mq_open
(
name
,
oflags
,
mode
,
&
mqattr
);
if
(
mqid
==
(
mqd_t
)
-
1
)
{
perror
(
"rt_logmod: mq_open "
);
return
;
}
}
else
{
perror
(
"rt_logmod: mq_open "
);
return
;
}
}
pthread_attr_init
(
&
pthreadattr
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment