Dillo v3.1.1-119-g140d9ebd
Loading...
Searching...
No Matches
dpi_socket_dir.c File Reference
#include <errno.h>
#include <stdlib.h>
#include "dpid_common.h"
#include "dpi.h"
#include "misc_new.h"
#include "dpi_socket_dir.h"
Include dependency graph for dpi_socket_dir.c:

Go to the source code of this file.

Functions

int w_dpi_socket_dir (char *dirname, char *sockdir)
 
int tst_dir (char *dir)
 
char * mk_sockdir (void)
 
char * init_sockdir (char *dpi_socket_dir)
 

Detailed Description

Create a per user temporary directory for dpi sockets

Definition in file dpi_socket_dir.c.

Function Documentation

◆ init_sockdir()

char * init_sockdir ( char *  dpi_socket_dir)

Create socket directory if it does not exist and save its name in ~/.dillo/dpi_socket_dir. \Return

  • Socket directory name on success
  • NULL on failure.

Definition at line 98 of file dpi_socket_dir.c.

References a_Dpi_rd_dpi_socket_dir(), dFree(), ERRMSG, mk_sockdir(), MSG_ERR, tst_dir(), and w_dpi_socket_dir().

Referenced by main().

◆ mk_sockdir()

char * mk_sockdir ( void  )

Create socket directory \Return

  • Socket directory path on success
  • NULL on failure

Definition at line 77 of file dpi_socket_dir.c.

References a_Misc_mkdtemp(), dFree(), dStrconcat(), ERRMSG, and MSG_ERR.

Referenced by init_sockdir().

◆ tst_dir()

int tst_dir ( char *  dir)

Test that socket directory exists and is a directory \Return

  • 1 on success
  • 0 on failure
    Bug:
    Does not check permissions or that it's a symbolic link to another directory.

Definition at line 54 of file dpi_socket_dir.c.

References dFree(), dStrconcat(), ERRMSG, and MSG_ERR.

Referenced by init_sockdir().

◆ w_dpi_socket_dir()

int w_dpi_socket_dir ( char *  dirname,
char *  sockdir 
)

Save socket directory name in ~/.dillo/dpi_socket_dir \Return

  • 1 on success
  • -1 on failure

Definition at line 34 of file dpi_socket_dir.c.

References ERRMSG.

Referenced by init_sockdir().