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
18c2bb40
Commit
18c2bb40
authored
8 months ago
by
Eric Vidal
Browse files
Options
Downloads
Patches
Plain Diff
Only leak when it's necessary.
Fix check of Build field. Don't warn user for nothing.
parent
4a852aac
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/66/66-execute.c
+8
-8
8 additions, 8 deletions
src/66/66-execute.c
with
8 additions
and
8 deletions
src/66/66-execute.c
+
8
−
8
View file @
18c2bb40
...
...
@@ -106,7 +106,6 @@ static void io_fdholder_retrieve(resolve_service_t *res, int fd, const char *nam
size_t
len
=
strlen
(
res
->
sa
.
s
+
res
->
live
.
fdholderdir
)
+
2
;
_alloc_stk_
(
sock
,
len
+
1
)
;
auto_strings
(
sock
.
s
,
res
->
sa
.
s
+
res
->
live
.
fdholderdir
,
"/s"
)
;
sock
.
s
[
len
]
=
0
;
sock
.
len
=
len
;
int
fdhold
;
...
...
@@ -119,7 +118,6 @@ static void io_fdholder_retrieve(resolve_service_t *res, int fd, const char *nam
_alloc_stk_
(
identifier
,
prefixlen
+
namelen
+
1
)
;
auto_strings
(
identifier
.
s
,
prefix
,
name
)
;
identifier
.
s
[
prefixlen
+
namelen
]
=
0
;
identifier
.
len
=
prefixlen
+
namelen
;
tain_now_set_stopwatch_g
()
;
...
...
@@ -137,8 +135,9 @@ static void io_fdholder_retrieve(resolve_service_t *res, int fd, const char *nam
if
(
fd_move
(
fd
,
fdhold
)
<
0
)
log_dieusys
(
LOG_EXIT_SYS
,
"move fd"
)
;
if
(
uncoe
(
fd
)
<
0
)
log_dieusys
(
LOG_EXIT_SYS
,
"uncoe fd"
)
;
if
(
!
fdhold
)
if
(
uncoe
(
fd
)
<
0
)
log_dieusys
(
LOG_EXIT_SYS
,
"uncoe fd"
)
;
}
static
void
io_open_file
(
resolve_service_t
*
res
,
int
fd
,
char
const
*
destination
)
...
...
@@ -202,7 +201,6 @@ static void io_open_destination(int fd, const char *destination, int flags, mode
}
}
static
void
io_read_file
(
stack
*
stk
,
const
char
*
file
,
size_t
len
)
{
log_flow
()
;
...
...
@@ -368,7 +366,7 @@ static void io_setup_stdin(resolve_service_t *res)
case
IO_TYPE_S6LOG
:
if
(
res
->
type
==
TYPE_CLASSIC
&&
res
->
islog
)
io_fdholder_retrieve
(
res
,
0
,
res
->
sa
.
s
+
res
->
name
,
0
)
;
io_fdholder_retrieve
(
res
,
0
,
res
->
sa
.
s
+
res
->
name
,
0
)
;
break
;
case
IO_TYPE_PARENT
:
...
...
@@ -378,6 +376,7 @@ static void io_setup_stdin(resolve_service_t *res)
case
IO_TYPE_FILE
:
case
IO_TYPE_SYSLOG
:
case
IO_TYPE_INHERIT
:
break
;
default:
log_warn
(
"unknown StdIn type -- applying default"
)
;
break
;
...
...
@@ -524,10 +523,11 @@ static void execute_script(const char *runuser, resolve_service_t *res, exlsn_t
_alloc_sa_
(
sa
)
;
uid_t
owner
=
getuid
()
;
uint32_t
want
=
(
action
==
EXECUTE_START
)
?
res
->
execute
.
run
.
build
:
res
->
execute
.
finish
.
build
;
short
build
=
!
strcmp
(
res
->
sa
.
s
+
want
,
"custom"
)
?
BUILD_CUSTOM
:
BUILD_AUTO
;
char
*
script
=
res
->
sa
.
s
+
(
action
==
EXECUTE_START
?
res
->
execute
.
run
.
run_user
:
res
->
execute
.
finish
.
run_user
)
;
size_t
scriptlen
=
strlen
(
script
)
;
if
(
!
want
)
{
if
(
!
build
)
{
r
=
el_substitute
(
&
sa
,
script
,
scriptlen
,
info
->
vars
.
s
,
info
->
values
.
s
,
genalloc_s
(
elsubst_t
const
,
&
info
->
data
),
genalloc_len
(
elsubst_t
const
,
&
info
->
data
))
;
...
...
@@ -714,7 +714,7 @@ int main(int argc, char const *const *argv, char const *const *envp)
/** We can now send message to a eventd handler socket.
* For now, just send a simple message */
log_info
(
action
==
EXECUTE_START
?
"
s
tarting"
:
"
s
topping"
,
" service: "
,
service
)
;
log_info
(
action
==
EXECUTE_START
?
"
S
tarting"
:
"
S
topping"
,
" service: "
,
service
)
;
xmexec_m
(
newargv
,
env
.
s
,
env
.
len
)
;
...
...
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