Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
mdmngr
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
IOPSYS
mdmngr
Commits
2ff4568a
Commit
2ff4568a
authored
7 years ago
by
Jakob Olsson
Browse files
Options
Downloads
Patches
Plain Diff
minor error fix, does not work yet
parent
139f59e4
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
common.c
+5
-0
5 additions, 0 deletions
common.c
common.h
+3
-1
3 additions, 1 deletion
common.h
dongle.c
+7
-5
7 additions, 5 deletions
dongle.c
with
15 additions
and
6 deletions
common.c
+
5
−
0
View file @
2ff4568a
...
@@ -48,3 +48,8 @@ struct blob_buf json_to_blob(struct json_object *response, struct blob_buf bb)
...
@@ -48,3 +48,8 @@ struct blob_buf json_to_blob(struct json_object *response, struct blob_buf bb)
return
bb
;
return
bb
;
}
}
void
set_debug
(
int
debug_arg
)
{
debug
=
debug_arg
;
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
common.h
+
3
−
1
View file @
2ff4568a
...
@@ -20,7 +20,7 @@
...
@@ -20,7 +20,7 @@
#include
<libubox/blobmsg.h>
#include
<libubox/blobmsg.h>
#include
<libubus.h>
#include
<libubus.h>
extern
int
debug
;
int
debug
;
#define debug_print(...) \
#define debug_print(...) \
do \
do \
...
@@ -57,4 +57,6 @@ int print_to_ubus(struct json_object *parsed_response, struct ubus_context *ctx,
...
@@ -57,4 +57,6 @@ int print_to_ubus(struct json_object *parsed_response, struct ubus_context *ctx,
* Blob buffer containing the replicated json_object.
* Blob buffer containing the replicated json_object.
*/
*/
struct
blob_buf
json_to_blob
(
struct
json_object
*
response
,
struct
blob_buf
bb
);
struct
blob_buf
json_to_blob
(
struct
json_object
*
response
,
struct
blob_buf
bb
);
void
set_debug
(
int
debug_arg
);
#endif
#endif
This diff is collapsed.
Click to expand it.
dongle.c
+
7
−
5
View file @
2ff4568a
...
@@ -15,17 +15,19 @@ int parse_args(int argc, char **argv)
...
@@ -15,17 +15,19 @@ int parse_args(int argc, char **argv)
{
{
char
ch
;
char
ch
;
printf
(
"hallå1
\n
"
);
while
((
ch
=
getopt_long
(
argc
,
argv
,
":d:"
,
long_options
,
NULL
))
!=
-
1
)
{
while
((
ch
=
getopt_long
(
argc
,
argv
,
":d:"
,
long_options
,
NULL
))
!=
-
1
)
{
int
fla
g
;
int
debug_ar
g
;
printf
(
"hallå2
\n
"
);
switch
(
ch
)
{
switch
(
ch
)
{
case
'd'
:
case
'd'
:
fla
g
=
atoi
(
ch
);
debug_ar
g
=
atoi
(
optarg
);
if
(
fla
g
>
1
||
fla
g
<
0
)
{
if
(
debug_ar
g
>
1
||
debug_ar
g
<
0
)
{
debug_print
(
"%s: option '-%c' is invalid.
\n
"
,
argv
[
0
],
optopt
);
debug_print
(
"%s: option '-%c' is invalid.
\n
"
,
argv
[
0
],
optopt
);
goto
fail
;
goto
fail
;
}
}
debug
=
flag
;
printf
(
"hallå3
\n
"
);
//set_debug(debug_arg);
break
;
break
;
case
':'
:
case
':'
:
debug_print
(
stderr
,
"%s: option '-%c' requires an argument
\n
"
,
argv
[
0
],
optopt
);
debug_print
(
stderr
,
"%s: option '-%c' requires an argument
\n
"
,
argv
[
0
],
optopt
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment