tweaks: avoid a compiler warning

master
Benno Schulenberg 2020-05-21 10:47:04 +02:00
parent b72f3b10ba
commit e0d00bc750
1 changed files with 2 additions and 2 deletions

View File

@ -129,7 +129,7 @@ bool write_lockfile(const char *lockfilename, const char *filename, bool modifie
struct passwd *mypwuid = getpwuid(myuid); struct passwd *mypwuid = getpwuid(myuid);
char myhostname[32]; char myhostname[32];
int fd; int fd;
FILE *filestream; FILE *filestream = NULL;
char *lockdata; char *lockdata;
size_t wroteamt; size_t wroteamt;
@ -155,7 +155,7 @@ bool write_lockfile(const char *lockfilename, const char *filename, bool modifie
if (fd > 0) if (fd > 0)
filestream = fdopen(fd, "wb"); filestream = fdopen(fd, "wb");
if (fd < 0 || filestream == NULL) { if (filestream == NULL) {
statusline(MILD, _("Error writing lock file %s: %s"), statusline(MILD, _("Error writing lock file %s: %s"),
lockfilename, strerror(errno)); lockfilename, strerror(errno));
if (fd > 0) if (fd > 0)