projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix: compat poll: add missing empty revents checks
[lttng-tools.git]
/
src
/
common
/
utils.c
diff --git
a/src/common/utils.c
b/src/common/utils.c
index e7dccb7b7490cb1c1392461304e70ea7cbf5d390..7f91dcb8151ea6ae6083668e78df123f73521758 100644
(file)
--- a/
src/common/utils.c
+++ b/
src/common/utils.c
@@
-477,10
+477,14
@@
int utils_create_pid_file(pid_t pid, const char *filepath)
ret = fprintf(fp, "%d\n", pid);
if (ret < 0) {
PERROR("fprintf pid file");
ret = fprintf(fp, "%d\n", pid);
if (ret < 0) {
PERROR("fprintf pid file");
+ goto error;
}
}
- fclose(fp);
+ if (fclose(fp)) {
+ PERROR("fclose");
+ }
DBG("Pid %d written in file %s", pid, filepath);
DBG("Pid %d written in file %s", pid, filepath);
+ ret = 0;
error:
return ret;
}
error:
return ret;
}
@@
-512,7
+516,7
@@
int utils_create_lock_file(const char *filepath)
*/
ret = flock(fd, LOCK_EX | LOCK_NB);
if (ret) {
*/
ret = flock(fd, LOCK_EX | LOCK_NB);
if (ret) {
-
WARN
("Could not get lock file %s, another instance is running.",
+
ERR
("Could not get lock file %s, another instance is running.",
filepath);
if (close(fd)) {
PERROR("close lock file");
filepath);
if (close(fd)) {
PERROR("close lock file");
This page took
0.023744 seconds
and
4
git commands to generate.