Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
B
bpm-sw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
bpm
bpm-sw
Commits
fede3552
Commit
fede3552
authored
Oct 09, 2015
by
Lucas Russo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dev_io/*: add option to specify the config file
parent
d1c97561
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
13 deletions
+9
-13
dev_io.c
src/dev_io/dev_io.c
+9
-13
No files found.
src/dev_io/dev_io.c
View file @
fede3552
...
...
@@ -31,18 +31,6 @@
CHECK_HAL_ERR(err, DEV_IO, "[dev_io]", \
devio_err_str (err_type))
#ifdef __CFG_DIR__
#define CFG_DIR STRINGIFY(__CFG_DIR__)
#else
#error "Config directory not defined!"
#endif
#ifdef __CFG_FILENAME__
#define CFG_FILENAME STRINGIFY(__CFG_FILENAME__)
#else
#error "Config filename not defined!"
#endif
#define LOG_FILENAME_LEN 50
/* This composes the log filename as "dev_io%u_fe%u.log" or
* "dev_io%u_be%u.log" */
...
...
@@ -85,6 +73,7 @@ void print_help (char *program_name)
"Usage: %s [options]
\n
"
"Version %s
\n
, Build by: %s, %s
\n
"
"
\t
-h This help message
\n
"
"
\t
-f Configuration file
\n
"
"
\t
-d Daemon mode.
\n
"
"
\t
-v Verbose output
\n
"
"
\t
-n <devio_type = [be|fe]> Devio type
\n
"
...
...
@@ -109,6 +98,7 @@ int main (int argc, char *argv[])
char
*
fe_smio_id_str
=
NULL
;
char
*
broker_endp
=
NULL
;
char
*
log_prefix
=
NULL
;
char
*
cfg_file
=
NULL
;
char
**
str_p
=
NULL
;
int
i
;
...
...
@@ -158,6 +148,10 @@ int main (int argc, char *argv[])
str_p
=
&
log_prefix
;
DBE_DEBUG
(
DBG_DEV_IO
|
DBG_LVL_TRACE
,
"[dev_io] Will set log filename
\n
"
);
}
else
if
(
streq
(
argv
[
i
],
"-f"
))
{
str_p
=
&
cfg_file
;
DBE_DEBUG
(
DBG_DEV_MNGR
|
DBG_LVL_TRACE
,
"[dev_mngr] Will set cfg_file parameter
\n
"
);
}
else
if
(
streq
(
argv
[
i
],
"-h"
))
{
print_help
(
argv
[
0
]);
exit
(
1
);
...
...
@@ -359,7 +353,7 @@ int main (int argc, char *argv[])
/**************************************************************************/
/* Check for field not found */
zconfig_t
*
root_cfg
=
zconfig_load
(
CFG_DIR
"/"
CFG_FILENAME
);
zconfig_t
*
root_cfg
=
zconfig_load
(
cfg_file
);
if
(
root_cfg
==
NULL
)
{
DBE_DEBUG
(
DBG_DEV_IO
|
DBG_LVL_FATAL
,
"[dev_io] Could not load "
"configuration file
\n
"
);
...
...
@@ -444,6 +438,8 @@ err_exit:
free
(
*
str_p
);
str_p
=
&
devio_type_str
;
free
(
*
str_p
);
str_p
=
&
cfg_file
;
free
(
*
str_p
);
return
0
;
}
...
...
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