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
f37882d7
Commit
f37882d7
authored
May 10, 2020
by
Houkime
Committed by
houkime
May 16, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
try to control qdb-related shared memory token files with TMPDIR
parent
f956956b
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
42 additions
and
20 deletions
+42
-20
src/exp/com/src/pwr_cleanup.sh
src/exp/com/src/pwr_cleanup.sh
+3
-0
src/lib/rt/src/rt_pool.c
src/lib/rt/src/rt_pool.c
+4
-4
src/lib/rt/src/rt_pool.h
src/lib/rt/src/rt_pool.h
+2
-2
src/lib/rt/src/rt_qdb.c
src/lib/rt/src/rt_qdb.c
+23
-10
src/lib/rt/src/rt_qdb.h
src/lib/rt/src/rt_qdb.h
+8
-3
src/lib/rt/src/rt_qini.c
src/lib/rt/src/rt_qini.c
+1
-0
src/lib/rt/src/rt_sect.h
src/lib/rt/src/rt_sect.h
+1
-1
No files found.
src/exp/com/src/pwr_cleanup.sh
View file @
f37882d7
...
...
@@ -50,4 +50,7 @@ eval `ipcs -q|grep ^0x|grep "[ \t]$USER[ \t]"|awk '{printf "ipcrm msg %s;", $2}'
# remove shared memory
eval
`
ipcs
-m
|grep ^0x|grep
"[
\t
]
$USER
[
\t
]"
|awk
'{printf "ipcrm shm %s;", $2}'
`
if
[
$TMPDIR
]
;
then
rm
$TMPDIR
/pwr
*
$PWR_BUS_ID
fi
rm
/tmp/pwr
*
$PWR_BUS_ID
src/lib/rt/src/rt_pool.c
View file @
f37882d7
...
...
@@ -267,7 +267,7 @@ static pool_sSegment* mapSegment(
pwr_tStatus
lsts
;
sect_sHead
*
shp
;
pwr_tBoolean
created
;
char
name
[
16
]
;
pwr_tFileName
name
;
pool_sGhead
*
gphp
=
php
->
gphp
;
/* Map the section */
...
...
@@ -303,7 +303,7 @@ static pool_sSegment* newSegment(pwr_tStatus* sts, pool_sHead* php,
sect_sHead
*
shp
;
pwr_tBoolean
created
;
pwr_tUInt32
i
;
char
name
[
16
]
;
pwr_tFileName
name
;
if
(
size
<<
pool_cOffsAlign
>
pool_cMaxSize
)
pwr_Return
(
NULL
,
sts
,
POOL__TOOBIG
);
...
...
@@ -352,9 +352,9 @@ static pool_sSegment* newSegment(pwr_tStatus* sts, pool_sHead* php,
The routine returns the workstr, filled in. */
static
char
*
segName
(
char
workstr
[
16
]
,
char
*
name
,
pwr_tUInt32
generation
)
static
char
*
segName
(
pwr_tFileName
workstr
,
char
*
name
,
pwr_tUInt32
generation
)
{
sprintf
(
workstr
,
"%
.11
s%4.4x"
,
name
,
generation
);
sprintf
(
workstr
,
"%s%4.4x"
,
name
,
generation
);
return
workstr
;
}
...
...
src/lib/rt/src/rt_pool.h
View file @
f37882d7
...
...
@@ -147,7 +147,7 @@ typedef struct {
pwr_tUInt32
fragsize
;
/* Total size of fragments, pool_sEntry units */
pwr_tUInt32
seg
;
/* Segment index */
pool_eSegType
type
;
char
name
[
16
]
;
/* Name of named segment. */
pwr_tFileName
name
;
/* Name of named segment. */
pwr_tUInt32
la_size
;
/* Lookaside size */
pwr_tUInt32
la_idx
;
/* Segment lookaside index. */
pwr_tUInt32
next_la_seg
;
/* Segment index */
...
...
@@ -164,7 +164,7 @@ typedef struct {
pwr_tUInt32
generation
;
/* Next generation number */
pwr_tUInt32
initsize
;
/* Segment 0 size in pool_sEntry units */
pwr_tUInt32
extendsize
;
/* Segment 1..n size in pool_sEntry units */
char
name
[
16
]
;
/* Name (prefix) */
pwr_tFileName
name
;
/* Name (prefix) */
pwr_tUInt32
la_idx
;
/* Next free lookaside index. */
pool_sList
la
[
pool_cLists
];
/* Lookaside lists. */
pool_sGsegment
seg
[
pool_cSegs
];
/* Entry for each segment */
...
...
src/lib/rt/src/rt_qdb.c
View file @
f37882d7
...
...
@@ -562,11 +562,23 @@ qdb_sLocal* qdb_CreateDb(pwr_tStatus* status, qdb_sInit* ip)
errh_Bugcheck
(
QDB__INSVIRMEM
,
"initiating local database"
);
qdb
->
my_pid
=
getpid
();
/* Define paths. */
char
*
tmpdir
=
getenv
(
"TMPDIR"
);
if
(
!
tmpdir
)
{
tmpdir
=
qdb_cDefaultTmpDir
;
}
sprintf
(
qdb
->
db_path
,
"%s/%s"
,
tmpdir
,
qdb_cFileNameDatabase
);
sprintf
(
qdb
->
db_lock_path
,
"%s/%s"
,
tmpdir
,
qdb_cFileNameDbLock
);
sprintf
(
qdb
->
pool_path
,
"%s/%s"
,
tmpdir
,
qdb_cFileNamePool
);
/* Create lock section. */
sp
=
sect_Alloc
(
sts
,
&
created
,
&
qdb
->
lock
,
sizeof
(
sect_sMutex
),
qdb
_cNameDbLock
,
sect_mFlags_Create
);
qdb
->
db_lock_path
,
sect_mFlags_Create
);
if
(
sp
==
NULL
)
errh_Bugcheck
(
*
sts
,
"creating db lock"
);
if
(
!
created
)
...
...
@@ -577,12 +589,13 @@ qdb_sLocal* qdb_CreateDb(pwr_tStatus* status, qdb_sInit* ip)
ip
=
evaluateInit
(
ip
);
pp
=
pool_Create
(
sts
,
&
qdb
->
pool
,
qdb
_cNamePool
,
ip
->
pool_isize
,
ip
->
pool_esize
);
sts
,
&
qdb
->
pool
,
qdb
->
pool_path
,
ip
->
pool_isize
,
ip
->
pool_esize
);
if
(
sp
==
NULL
)
errh_Bugcheck
(
*
sts
,
"initating pool"
);
qdb
->
g
=
pool_AllocNamedSegment
(
sts
,
&
qdb
->
pool
,
sizeof
(
*
qdb
->
g
),
qdb_cNameDatabase
);
sts
,
&
qdb
->
pool
,
sizeof
(
*
qdb
->
g
),
qdb
->
db_path
);
if
(
qdb
->
g
==
NULL
)
errh_Bugcheck
(
*
sts
,
"database directory"
);
...
...
@@ -692,7 +705,7 @@ static void unlinkPool(const char* name)
struct
shmid_ds
ds
;
char
*
str
=
getenv
(
pwr_dEnvBusId
);
char
segname
[
128
]
;
pwr_tFileName
segname
;
char
busid
[
8
];
strncpy
(
busid
,
(
str
?
str
:
"XXX"
),
3
);
...
...
@@ -732,7 +745,7 @@ static void unlinkPool(const char* name)
void
qdb_UnlinkDb
()
{
char
segname
[
128
]
;
pwr_tFileName
segname
;
char
busid
[
8
];
char
*
str
=
getenv
(
pwr_dEnvBusId
);
key_t
key
;
...
...
@@ -741,14 +754,14 @@ void qdb_UnlinkDb()
/* Unlink pool. */
unlinkPool
(
qdb
_cNamePool
);
unlinkPool
(
qdb
->
pool_path
);
/* Remove database lock. */
strncpy
(
busid
,
(
str
?
str
:
"XXX"
),
3
);
busid
[
3
]
=
'\0'
;
sprintf
(
segname
,
"%s_%.3s"
,
qdb
_cNameDbLock
,
busid
);
sprintf
(
segname
,
"%s_%.3s"
,
qdb
->
db_lock_path
,
busid
);
key
=
ftok
(
segname
,
'P'
);
shm_id
=
shmget
(
key
,
0
,
0660
);
...
...
@@ -778,7 +791,7 @@ qdb_sLocal* qdb_MapDb(pwr_tStatus* status)
/* Map lock sections. */
sp
=
sect_Alloc
(
sts
,
&
created
,
&
qdb
->
lock
,
sizeof
(
sect_sMutex
),
qdb
_cNameDbLock
,
0
);
sts
,
&
created
,
&
qdb
->
lock
,
sizeof
(
sect_sMutex
),
qdb
->
db_lock_path
,
0
);
if
(
sp
==
NULL
)
errh_Bugcheck
(
*
sts
,
"mapping db lock"
);
if
(
created
)
...
...
@@ -792,12 +805,12 @@ qdb_sLocal* qdb_MapDb(pwr_tStatus* status)
/* Map 'pool' & 'rtdb' pools. */
pp
=
pool_Create
(
sts
,
&
qdb
->
pool
,
qdb
_cNamePool
,
0
,
0
);
pp
=
pool_Create
(
sts
,
&
qdb
->
pool
,
qdb
->
pool_path
,
0
,
0
);
if
(
pp
==
NULL
)
errh_Bugcheck
(
*
sts
,
"initating pool"
);
qdb
->
g
=
pool_AllocNamedSegment
(
sts
,
&
qdb
->
pool
,
sizeof
(
*
qdb
->
g
),
qdb
_cNameDatabase
);
sts
,
&
qdb
->
pool
,
sizeof
(
*
qdb
->
g
),
qdb
->
db_path
);
if
(
qdb
->
g
==
NULL
)
errh_Bugcheck
(
*
sts
,
"database directory"
);
...
...
src/lib/rt/src/rt_qdb.h
View file @
f37882d7
...
...
@@ -70,10 +70,11 @@ static const qcom_sQid qdb_cQimport = { qdb_cIimport, 0 };
static
const
qcom_sQid
qdb_cQexport
=
{
qdb_cIexport
,
0
};
static
const
qcom_sQid
qdb_cQmonitor
=
{
qdb_cImonitor
,
0
};
#define qdb_cNameDatabase "/tmp/pwr_qdb"
#define qdb_cDefaultTmpDir "/tmp/"
#define qdb_cFileNameDatabase "pwr_qdb"
#define qdb_cFileNameDbLock "pwr_qdb_lock"
#define qdb_cNamePool "/tmp/pwr_qpool"
#define qdb_cNameDbLock "/tmp/pwr_qdb_lock"
#define qdb_cFileNamePool "pwr_qpool"
#if defined OS_LINUX
#define qdb_cSigMsg SIGRTMIN
...
...
@@ -667,6 +668,10 @@ typedef struct {
qdb_sAppl
*
ap
;
/* my application */
qdb_sQue
*
exportque
;
/* the export que */
pwr_tFileName
db_lock_path
;
pwr_tFileName
db_path
;
pwr_tFileName
pool_path
;
}
qdb_sLocal
;
/* The root of all data, the only `global' variable... */
...
...
src/lib/rt/src/rt_qini.c
View file @
f37882d7
...
...
@@ -37,6 +37,7 @@
/* rt_qini.c -- Queue Communication, initiation */
#include <stdlib.h>
#include <stdio.h>
#include "co_string.h"
...
...
src/lib/rt/src/rt_sect.h
View file @
f37882d7
...
...
@@ -62,7 +62,7 @@ typedef union {
typedef
struct
{
void
*
base
;
/* Virtual address of section. */
size_t
size
;
char
name
[
32
]
;
/* Name of section. */
pwr_tFileName
name
;
/* Name of section. */
sect_mHead
flags
;
}
sect_sHead
;
...
...
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