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
ab399ca7
Commit
ab399ca7
authored
Jun 13, 2013
by
Leigh B Stoller
Browse files
Fix to previous revision. Also check return of pclose.
parent
533f7030
Changes
1
Hide whitespace changes
Inline
Side-by-side
tmcd/tmcd.c
View file @
ab399ca7
...
...
@@ -11344,7 +11344,7 @@ getImageInfo(char *path, char *nodeid, char *pid, char *imagename,
* "nobody". If so, use the imageinfo helper to get the info
* via the frisbee master server.
*/
if (
!
stat(path, &sb)) {
if (stat(path, &sb)) {
char _buf[512];
FILE *cfd;
...
...
@@ -11361,7 +11361,8 @@ getImageInfo(char *path, char *nodeid, char *pid, char *imagename,
}
_buf[0] = 0;
fgets(_buf, sizeof _buf, cfd);
pclose(cfd);
if (pclose(cfd))
goto badimage1;
sb.st_mtime = 0;
if (_buf[0] != 0 && _buf[0] != '\n') {
sscanf(_buf, "%u", &sb.st_mtime);
...
...
@@ -11382,7 +11383,8 @@ getImageInfo(char *path, char *nodeid, char *pid, char *imagename,
}
_buf[0] = 0;
fgets(_buf, sizeof _buf, cfd);
pclose(cfd);
if (pclose(cfd))
goto badimage2;
sb.st_size = 0;
if (_buf[0] != 0 && _buf[0] != '\n') {
sscanf(_buf, "%lld", &sb.st_size);
...
...
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