commit e0d00bc750d4f984a298175a9a8e8d3f30ae948d
parent b72f3b10ba6052720625534e73030d1fd4bb6040
Author: Benno Schulenberg <bensberg@telfort.nl>
Date: Thu, 21 May 2020 10:47:04 +0200
tweaks: avoid a compiler warning
Diffstat:
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/files.c b/src/files.c
@@ -129,7 +129,7 @@ bool write_lockfile(const char *lockfilename, const char *filename, bool modifie
struct passwd *mypwuid = getpwuid(myuid);
char myhostname[32];
int fd;
- FILE *filestream;
+ FILE *filestream = NULL;
char *lockdata;
size_t wroteamt;
@@ -155,7 +155,7 @@ bool write_lockfile(const char *lockfilename, const char *filename, bool modifie
if (fd > 0)
filestream = fdopen(fd, "wb");
- if (fd < 0 || filestream == NULL) {
+ if (filestream == NULL) {
statusline(MILD, _("Error writing lock file %s: %s"),
lockfilename, strerror(errno));
if (fd > 0)