Skip to content

Commit

Permalink
fixup! clients/upslog.c, docs/man/upslog.txt, NEWS.adoc: Same log fil…
Browse files Browse the repository at this point in the history
…e may now safely be used in different logging tuples
  • Loading branch information
jimklimov committed Jan 6, 2025
1 parent 1345679 commit 2a24884
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions clients/upslog.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,35 +86,35 @@
"%VAR input.voltage% %VAR ups.load% [%VAR ups.status%] " \
"%VAR ups.temperature% %VAR input.frequency%"

static struct logtarget_t *get_logfile(const char *logfn)
static struct logtarget_t *get_logfile(const char *logfn_arg)
{
struct logtarget_t *p = NULL;

if (!logfn || !(*logfn) || !logfile_anchor)
if (!logfn_arg || !(*logfn_arg) || !logfile_anchor)
return p;

for (p = logfile_anchor; p != NULL; p = p->next) {
if (!strcmp(logfn, p->logfn))
if (!strcmp(logfn_arg, p->logfn))
return p;
}

/* NULL by now */
return p;
}

static struct logtarget_t *add_logfile(const char *logfn)
static struct logtarget_t *add_logfile(const char *logfn_arg)
{
struct logtarget_t *p = get_logfile(logfn);
struct logtarget_t *p = get_logfile(logfn_arg);

if (p)
return p;

/* Ignore bogus additions; FIXME: Error out? */
if (!logfn || !(*logfn))
if (!logfn_arg || !(*logfn_arg))
return p;

p = xcalloc(1, sizeof(struct monhost_ups));
p->logfn = xstrdup(logfn);
p->logfn = xstrdup(logfn_arg);
p->logfile = NULL;

/* Inject into the chain, head is as good a place as any */
Expand Down

0 comments on commit 2a24884

Please sign in to comment.