Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
emulab
emulab-devel
Commits
c2024213
Commit
c2024213
authored
Apr 03, 2002
by
Leigh B. Stoller
Browse files
Minor fix to start status handling; sscanf the string since there
might be some extra whitespace (well, there *is* extra whitespace).
parent
0ac47d14
Changes
1
Hide whitespace changes
Inline
Side-by-side
tmcd/tmcd.c
View file @
c2024213
...
...
@@ -1688,7 +1688,7 @@ COMMAND_PROTOTYPE(dostartstat)
char
pid
[
64
];
char
eid
[
64
];
char
gid
[
64
];
char
*
exitstatus
;
int
exitstatus
;
if
(
iptonodeid
(
ipaddr
,
nodeid
))
{
syslog
(
LOG_ERR
,
"STARTSTAT: %s: No such node"
,
...
...
@@ -1699,12 +1699,14 @@ COMMAND_PROTOTYPE(dostartstat)
/*
* Dig out the exit status
*/
while
(
isspace
(
*
rdata
))
rdata
++
;
exitstatus
=
rdata
;
if
(
!
sscanf
(
rdata
,
"%d"
,
&
exitstatus
))
{
syslog
(
LOG_ERR
,
"STARTSTAT: %s: Invalid exit status: %s"
,
inet_ntoa
(
ipaddr
),
rdata
);
return
1
;
}
syslog
(
LOG_INFO
,
"STARTSTAT: "
"%s is reporting startup command exit status: %
s
"
,
"%s is reporting startup command exit status: %
d
"
,
nodeid
,
exitstatus
);
/*
...
...
@@ -1715,15 +1717,12 @@ COMMAND_PROTOTYPE(dostartstat)
return
0
;
}
syslog
(
LOG_INFO
,
"STARTSTAT: %s: Node is in experiment %s/%s"
,
nodeid
,
pid
,
eid
);
/*
* Update the node table record with the exit status. Setting the
* field to a non-null string value is enough to tell whoever is
* watching it that the node is done.
*/
if
(
mydb_update
(
"update nodes set startstatus='%
s
' "
if
(
mydb_update
(
"update nodes set startstatus='%
d
' "
"where node_id='%s'"
,
exitstatus
,
nodeid
))
{
syslog
(
LOG_ERR
,
"STARTSTAT: %s: DB Error setting exit status!"
,
nodeid
);
...
...
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