Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Jean-Baptiste Kempf
libaacs
Commits
5b8eb9aa
Commit
5b8eb9aa
authored
Oct 07, 2013
by
npzacs
Browse files
Cosmetics
parent
e274ebb0
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/file/keydbcfg.c
View file @
5b8eb9aa
...
...
@@ -61,6 +61,37 @@
#define MAX_FILE_SIZE 65535
static
int
_mkpath
(
const
char
*
path
)
{
struct
stat
s
;
int
result
=
1
;
char
*
dir
=
str_printf
(
"%s"
,
path
);
char
*
end
=
dir
;
while
(
*
end
==
'/'
)
end
++
;
while
((
end
=
strchr
(
end
,
'/'
)))
{
*
end
=
0
;
if
(
stat
(
dir
,
&
s
)
!=
0
||
!
S_ISDIR
(
s
.
st_mode
))
{
DEBUG
(
DBG_FILE
,
"Creating directory %s
\n
"
,
dir
);
if
(
mkdir
(
dir
,
S_IRWXU
|
S_IRWXG
|
S_IRWXO
)
==
-
1
)
{
DEBUG
(
DBG_FILE
,
"Error creating directory %s
\n
"
,
dir
);
result
=
0
;
break
;
}
}
*
end
++
=
'/'
;
}
X_FREE
(
dir
);
return
result
;
}
static
char
*
_load_file
(
FILE
*
fp
)
{
char
*
data
=
NULL
;
...
...
@@ -290,37 +321,6 @@ static int _load_cert_file(config_file *cf)
return
result
;
}
static
int
_mkpath
(
const
char
*
path
)
{
struct
stat
s
;
int
result
=
1
;
char
*
dir
=
str_printf
(
"%s"
,
path
);
char
*
end
=
dir
;
while
(
*
end
==
'/'
)
end
++
;
while
((
end
=
strchr
(
end
,
'/'
)))
{
*
end
=
0
;
if
(
stat
(
dir
,
&
s
)
!=
0
||
!
S_ISDIR
(
s
.
st_mode
))
{
DEBUG
(
DBG_FILE
,
"Creating directory %s
\n
"
,
dir
);
if
(
mkdir
(
dir
,
S_IRWXU
|
S_IRWXG
|
S_IRWXO
)
==
-
1
)
{
DEBUG
(
DBG_FILE
,
"Error creating directory %s
\n
"
,
dir
);
result
=
0
;
break
;
}
}
*
end
++
=
'/'
;
}
X_FREE
(
dir
);
return
result
;
}
static
char
*
_keycache_file
(
const
char
*
type
,
const
uint8_t
*
disc_id
)
{
const
char
*
cache_dir
=
get_cache_home
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment