Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
einsteinathome
boinc
Commits
d2c91e16
Commit
d2c91e16
authored
Oct 14, 2015
by
David Anderson
Browse files
client, condor, remote submit: fix a few Coverity warnings
parent
a27cffc1
Changes
3
Hide whitespace changes
Inline
Side-by-side
client/thread.cpp
View file @
d2c91e16
...
...
@@ -29,7 +29,8 @@ int THREAD::run(void*(*func)(void*), void* _arg) {
pthread_t
id
;
pthread_attr_t
thread_attrs
;
pthread_attr_init
(
&
thread_attrs
);
pthread_create
(
&
id
,
&
thread_attrs
,
func
,
this
);
int
retval
=
pthread_create
(
&
id
,
&
thread_attrs
,
func
,
this
);
if
(
retval
)
return
retval
;
#endif
arg
=
_arg
;
return
0
;
...
...
lib/remote_submit.h
View file @
d2c91e16
...
...
@@ -95,7 +95,6 @@ struct COMPLETED_JOB_DESC {
double
cpu_time
;
string
stderr_out
;
COMPLETED_JOB_DESC
(){}
int
parse
(
XML_PARSER
&
);
};
...
...
samples/condor/boinc_gahp.cpp
View file @
d2c91e16
...
...
@@ -41,6 +41,8 @@ using std::set;
using
std
::
string
;
using
std
::
vector
;
extern
size_t
strlcpy
(
char
*
,
const
char
*
,
size_t
);
char
project_url
[
256
];
char
authenticator
[
256
];
char
response_prefix
[
256
];
...
...
@@ -220,12 +222,12 @@ int process_input_files(SUBMIT_REQ& req, string& error_msg) {
// parse the text coming from Condor
//
int
COMMAND
::
parse_submit
(
char
*
p
)
{
strcpy
(
submit_req
.
batch_name
,
strtok_r
(
NULL
,
" "
,
&
p
));
strcpy
(
submit_req
.
app_name
,
strtok_r
(
NULL
,
" "
,
&
p
));
str
l
cpy
(
submit_req
.
batch_name
,
strtok_r
(
NULL
,
" "
,
&
p
)
,
sizeof
(
submit_req
.
batch_name
)
);
str
l
cpy
(
submit_req
.
app_name
,
strtok_r
(
NULL
,
" "
,
&
p
)
,
sizeof
(
submit_req
.
app_name
)
);
int
njobs
=
atoi
(
strtok_r
(
NULL
,
" "
,
&
p
));
for
(
int
i
=
0
;
i
<
njobs
;
i
++
)
{
JOB
job
;
strcpy
(
job
.
job_name
,
strtok_r
(
NULL
,
" "
,
&
p
));
str
l
cpy
(
job
.
job_name
,
strtok_r
(
NULL
,
" "
,
&
p
)
,
sizeof
(
job
.
job_name
)
);
int
nargs
=
atoi
(
strtok_r
(
NULL
,
" "
,
&
p
));
for
(
int
j
=
0
;
j
<
nargs
;
j
++
)
{
string
arg
=
strtok_r
(
NULL
,
" "
,
&
p
);
...
...
@@ -234,8 +236,8 @@ int COMMAND::parse_submit(char* p) {
int
ninfiles
=
atoi
(
strtok_r
(
NULL
,
" "
,
&
p
));
for
(
int
j
=
0
;
j
<
ninfiles
;
j
++
)
{
INFILE
infile
;
strcpy
(
infile
.
src_path
,
strtok_r
(
NULL
,
" "
,
&
p
));
strcpy
(
infile
.
logical_name
,
strtok_r
(
NULL
,
" "
,
&
p
));
str
l
cpy
(
infile
.
src_path
,
strtok_r
(
NULL
,
" "
,
&
p
)
,
sizeof
(
infile
.
src_path
)
);
str
l
cpy
(
infile
.
logical_name
,
strtok_r
(
NULL
,
" "
,
&
p
)
,
sizeof
(
infile
.
logical_name
)
);
job
.
infiles
.
push_back
(
infile
);
}
submit_req
.
jobs
.
push_back
(
job
);
...
...
@@ -344,11 +346,11 @@ void handle_query_batches(COMMAND& c) {
int
COMMAND
::
parse_fetch_output
(
char
*
p
)
{
char
*
q
=
strtok_r
(
NULL
,
" "
,
&
p
);
if
(
!
q
)
return
-
1
;
strcpy
(
fetch_output_req
.
job_name
,
q
);
str
l
cpy
(
fetch_output_req
.
job_name
,
q
,
sizeof
(
fetch_output_req
.
job_name
)
);
q
=
strtok_r
(
NULL
,
" "
,
&
p
);
if
(
!
q
)
return
-
1
;
strcpy
(
fetch_output_req
.
dir
,
q
);
str
l
cpy
(
fetch_output_req
.
dir
,
q
,
sizeof
(
fetch_output_req
.
dir
)
);
q
=
strtok_r
(
NULL
,
" "
,
&
p
);
if
(
!
q
)
return
-
1
;
...
...
@@ -367,8 +369,8 @@ int COMMAND::parse_fetch_output(char* p) {
int
nfiles
=
atoi
(
strtok_r
(
NULL
,
" "
,
&
p
));
for
(
int
i
=
0
;
i
<
nfiles
;
i
++
)
{
OUTFILE
of
;
strcpy
(
of
.
src
,
strtok_r
(
NULL
,
" "
,
&
p
));
strcpy
(
of
.
dest
,
strtok_r
(
NULL
,
" "
,
&
p
));
str
l
cpy
(
of
.
src
,
strtok_r
(
NULL
,
" "
,
&
p
)
,
sizeof
(
of
.
src
)
);
str
l
cpy
(
of
.
dest
,
strtok_r
(
NULL
,
" "
,
&
p
)
,
sizeof
(
of
.
dest
)
);
fetch_output_req
.
file_descs
.
push_back
(
of
);
}
return
0
;
...
...
@@ -505,7 +507,7 @@ void handle_fetch_output(COMMAND& c) {
OUTFILE
&
of
=
req
.
file_descs
[
i
];
if
(
!
strcmp
(
of
.
src
,
of
.
dest
))
continue
;
if
(
of
.
dest
[
0
]
==
'/'
)
{
strcpy
(
dst_path
,
of
.
dest
);
str
l
cpy
(
dst_path
,
of
.
dest
,
sizeof
(
dst_path
)
);
}
else
{
sprintf
(
dst_path
,
"%s/%s"
,
req
.
dir
,
of
.
dest
);
}
...
...
@@ -545,7 +547,7 @@ void handle_abort_jobs(COMMAND& c) {
}
int
COMMAND
::
parse_retire_batch
(
char
*
p
)
{
strcpy
(
batch_name
,
strtok_r
(
NULL
,
" "
,
&
p
));
str
l
cpy
(
batch_name
,
strtok_r
(
NULL
,
" "
,
&
p
)
,
sizeof
(
batch_name
)
);
return
0
;
}
...
...
@@ -566,7 +568,7 @@ void handle_retire_batch(COMMAND& c) {
}
int
COMMAND
::
parse_set_lease
(
char
*
p
)
{
strcpy
(
batch_name
,
strtok_r
(
NULL
,
" "
,
&
p
));
str
l
cpy
(
batch_name
,
strtok_r
(
NULL
,
" "
,
&
p
)
,
sizeof
(
batch_name
)
);
lease_end_time
=
atof
(
strtok_r
(
NULL
,
" "
,
&
p
));
return
0
;
}
...
...
@@ -691,7 +693,7 @@ int handle_command(char* p) {
}
else
if
(
!
strcasecmp
(
cmd
,
"RESPONSE_PREFIX"
))
{
flockfile
(
stdout
);
BPRINTF
(
"S
\n
"
);
strcpy
(
response_prefix
,
p
+
strlen
(
"RESPONSE_PREFIX "
));
str
l
cpy
(
response_prefix
,
p
+
strlen
(
"RESPONSE_PREFIX "
)
,
sizeof
(
response_prefix
)
);
funlockfile
(
stdout
);
}
else
if
(
!
strcasecmp
(
cmd
,
"ASYNC_MODE_ON"
))
{
flockfile
(
stdout
);
...
...
Write
Preview
Supports
Markdown
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