Displaying 3 results from an estimated 3 matches for "dflt_statepath".
2005 Oct 23
0
FC4 + nut => shutdown sequence conundrum
...var/spool and /var/mail can grow and
potentially consume the entire volume.
Looking at the source code for drivers/main.c I observe that the chdir is
happening in main() on line 551. The call to shutdown the UPS happens a
few lines later, on line 568. The interesting lines are:
if (chdir(dflt_statepath()))
fatal("Can't chdir to %s", dflt_statepath());
setup_signals();
/* clear out callback handler data */
memset(&upsh, '\0', sizeof(upsh));
upsdrv_initups();
/* now see if things are very wrong out there */...
2011 Jan 19
1
[nut-commits] svn commit r2845 - branches/windows_port/common
...ullpath is allocating memory with xstrdup. Doesn't this line produce
a memory leak ?
> #endif
> - }
> -
> - return path;
> + return (path != NULL) ? path : CONFPATH;
> }
>
> /* Return the default path for the directory containing state files */
> -const char * dflt_statepath(void)
> +const char * dflt_statepath(void)
> {
> - const char * path;
> -
> - if ((path = getenv("NUT_STATEPATH")) == NULL) {
> #ifndef WIN32
> - path = STATEPATH;
> + const char *path = getenv("NUT_STATEPATH");
> #else
> - if( relative_state_...
2007 May 18
1
i'm confused
...ails with "upsd[2947]: Can't connect to UPS [apc] (apc): No such
file or directory".
So i looked at the code for and found that in drivers/dstate.c
dstate_init function creates the socket as follows -
snprintf(sockname, sizeof(sockname), "%s/%s-%s",
dflt_statepath(), prog, port);
which is fine, but if i'm right upsd via server/conf.c in function
upsconf_add is trying set the name of the socket to be opened as -
snprintf(statefn, sizeof(statefn), "%s",
tmp->upsname);
so it error's as above. If i call t...