diff options
author | Scott Moser <smoser@brickies.net> | 2018-09-19 17:21:48 -0400 |
---|---|---|
committer | Scott Moser <smoser@brickies.net> | 2018-09-19 17:37:45 -0400 |
commit | 38952aa277df116da0b7ef389440de34a3e61cd0 (patch) | |
tree | 3d0f787dc359574668f270ddc7c002121ba22cad /iscsiuio | |
parent | acd431211885d07eb9effe0d5b5f55a90d00cfbd (diff) | |
download | open-iscsi-38952aa277df116da0b7ef389440de34a3e61cd0.tar.gz |
Close file handles when writing pid files.
The file descriptors used for writing to the pid file were
not being closed. Just be more clean and close them.
Also fix a debug message that said 'lock file' rather than 'pid file'.
Diffstat (limited to 'iscsiuio')
-rw-r--r-- | iscsiuio/src/unix/main.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/iscsiuio/src/unix/main.c b/iscsiuio/src/unix/main.c index 5cccc76..457ebe3 100644 --- a/iscsiuio/src/unix/main.c +++ b/iscsiuio/src/unix/main.c @@ -346,8 +346,9 @@ int main(int argc, char *argv[]) sprintf(buf, "%d\n", getpid()); written_bytes = write(fd, buf, strlen(buf)); if (written_bytes == -1) - printf("Could not write lock file [%s]", + printf("Could not write pid file [%s]", strerror(errno)); + close(fd); daemon_init(); } |