Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
6
66
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Eric Vidal
66
Commits
fa4b0569
Commit
fa4b0569
authored
2 years ago
by
Eric Vidal
Browse files
Options
Downloads
Patches
Plain Diff
add create_live_tree function
parent
cdae6186
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/lib66/utils/create_live_tree.c
+46
-0
46 additions, 0 deletions
src/lib66/utils/create_live_tree.c
with
46 additions
and
0 deletions
src/lib66/utils/create_live_tree.c
0 → 100644
+
46
−
0
View file @
fa4b0569
/*
* create_live_tree.c
*
* Copyright (c) 2018-2021 Eric Vidal <eric@obarun.org>
*
* All rights reserved.
*
* This file is part of Obarun. It is subject to the license terms in
* the LICENSE file found in the top-level directory of this
* distribution.
* This file may not be copied, modified, propagated, or distributed
* except according to the terms contained in the LICENSE file./
*/
#include
<sys/types.h>
#include
<unistd.h>
#include
<oblibs/log.h>
#include
<oblibs/string.h>
#include
<oblibs/types.h>
#include
<oblibs/directory.h>
#include
<66/ssexec.h>
#include
<66/utils.h>
#include
<66/constants.h>
int
create_live_tree
(
ssexec_t
*
info
)
{
log_flow
()
;
int
r
=
scan_mode
(
info
->
livetree
.
s
,
S_IFDIR
)
;
if
(
r
<
0
)
log_warn_return
(
LOG_EXIT_ZERO
,
"conflicting format for: "
,
info
->
livetree
.
s
)
;
if
(
!
r
)
{
log_trace
(
"create directory: "
,
info
->
livetree
.
s
)
;
if
(
!
dir_create
(
info
->
livetree
.
s
,
0700
))
log_warnusys_return
(
LOG_EXIT_ZERO
,
"create directory: "
,
info
->
livetree
.
s
)
;
log_trace
(
"chown directory: "
,
info
->
livetree
.
s
)
;
if
(
chown
(
info
->
livetree
.
s
,
info
->
owner
,
gidowner
)
<
0
)
log_warnusys_return
(
LOG_EXIT_SYS
,
"chown directory: "
,
info
->
livetree
.
s
)
;
}
return
1
;
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment