38 if ((dir = fopen(dirname,
"w")) == NULL) {
39 ERRMSG(
"w_dpi_socket_dir",
"fopen", errno);
42 fprintf(dir,
"%s", sockdir);
61 if (access(dirtest, F_OK) == -1) {
62 ERRMSG(
"tst_dir",
"access", errno);
79 char *
template, *logname;
81 logname = getenv(
"LOGNAME") ? getenv(
"LOGNAME") :
"dillo";
82 template =
dStrconcat(
"/tmp/", logname,
"-",
"XXXXXX", NULL);
84 ERRMSG(
"mk_sockdir",
"a_Misc_mkdtemp", 0);
100 char *sockdir = NULL;
104 MSG_ERR(
"init_sockdir: The dpi_socket_dir file %s does not exist\n",
107 if ((dir_ok =
tst_dir(sockdir)) == 1) {
108 MSG_ERR(
"init_sockdir: The socket directory %s exists and is OK\n",
111 MSG_ERR(
"init_sockdir: The socket directory %s does not exist "
112 "or is not a directory\n", sockdir);
118 if (sockdir == NULL) {
119 ERRMSG(
"init_sockdir",
"mk_sockdir", 0);
120 MSG_ERR(
" - Failed to create dpi socket directory\n");
122 ERRMSG(
"init_sockdir",
"w_dpi_socket_dir", 0);
123 MSG_ERR(
" - failed to save %s\n", sockdir);
char * dStrconcat(const char *s1,...)
Concatenate a NULL-terminated list of strings.
char * init_sockdir(char *dpi_socket_dir)
int w_dpi_socket_dir(char *dirname, char *sockdir)
char * a_Dpi_rd_dpi_socket_dir(char *dirname)
#define ERRMSG(CALLER, CALLED, ERR)
char * a_Misc_mkdtemp(char *template)
Alternative to mkdtemp().