MCPcopy Create free account
hub / github.com/dillo-browser/dillo / tst_dir

Function tst_dir

dpid/dpi_socket_dir.c:54–70  ·  view source on GitHub ↗

! Test that socket directory exists and is a directory * \Return * \li 1 on success * \li 0 on failure * \bug Does not check permissions or that it's a symbolic link * to another directory. */

Source from the content-addressed store, hash-verified

52 * to another directory.
53 */
54int tst_dir(char *dir)
55{
56 char *dirtest;
57 int ret = 0;
58
59 /* test for a directory */
60 dirtest = dStrconcat(dir, "/", NULL);
61 if (access(dirtest, F_OK) == -1) {
62 ERRMSG("tst_dir", "access", errno);
63 MSG_ERR(" - %s\n", dirtest);
64 } else {
65 ret = 1;
66 }
67 dFree(dirtest);
68
69 return ret;
70}
71
72/*! Create socket directory
73 * \Return

Callers 1

init_sockdirFunction · 0.85

Calls 2

dStrconcatFunction · 0.85
dFreeFunction · 0.85

Tested by

no test coverage detected