Use the environment variable TMPDIR when defined for the socket
This commit is contained in:
parent
7da146ba30
commit
3c037eddb1
@ -179,6 +179,7 @@ static gboolean _init_timeout(gpointer data)
|
|||||||
int ret = TRUE;
|
int ret = TRUE;
|
||||||
WPA * wpa = data;
|
WPA * wpa = data;
|
||||||
char const path[] = WPA_SUPPLICANT_PATH;
|
char const path[] = WPA_SUPPLICANT_PATH;
|
||||||
|
char const * p;
|
||||||
DIR * dir;
|
DIR * dir;
|
||||||
struct dirent * de;
|
struct dirent * de;
|
||||||
struct stat st;
|
struct stat st;
|
||||||
@ -188,8 +189,10 @@ static gboolean _init_timeout(gpointer data)
|
|||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
fprintf(stderr, "DEBUG: %s()\n", __func__);
|
fprintf(stderr, "DEBUG: %s()\n", __func__);
|
||||||
#endif
|
#endif
|
||||||
snprintf(wpa->path, sizeof(wpa->path), "%s",
|
if((p = getenv("TMPDIR")) == NULL)
|
||||||
TMPDIR "/panel_wpa_supplicant.XXXXXX");
|
p = TMPDIR;
|
||||||
|
snprintf(wpa->path, sizeof(wpa->path), "%s%s", p,
|
||||||
|
"/panel_wpa_supplicant.XXXXXX");
|
||||||
if(mktemp(wpa->path) == NULL)
|
if(mktemp(wpa->path) == NULL)
|
||||||
{
|
{
|
||||||
wpa->helper->error(NULL, "mktemp", 1);
|
wpa->helper->error(NULL, "mktemp", 1);
|
||||||
|
Loading…
Reference in New Issue
Block a user