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
b418ca48
Commit
b418ca48
authored
5 years ago
by
Eric Vidal
Browse files
Options
Downloads
Patches
Plain Diff
Do not attempt to unmount SS_LIVE
parent
e3fa5ba9
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/extra-tools/66-umountall.c
+13
-5
13 additions, 5 deletions
src/extra-tools/66-umountall.c
with
13 additions
and
5 deletions
src/extra-tools/66-umountall.c
+
13
−
5
View file @
b418ca48
...
...
@@ -23,10 +23,13 @@
#include
<sys/mount.h>
#include
<oblibs/log.h>
#include
<oblibs/string.h>
#include
<skalibs/stralloc.h>
#include
<skalibs/skamisc.h>
#include
<66/config.h>
#define MAXLINES 99
#define EXCLUDEN 3
...
...
@@ -35,16 +38,20 @@ static char const *exclude_type[EXCLUDEN] = { "devtmpfs", "proc", "sysfs" } ;
int
main
(
int
argc
,
char
const
*
const
*
argv
)
{
size_t
mountpoints
[
MAXLINES
]
;
size_t
mountpoints
[
MAXLINES
],
tmplen
=
strlen
(
SS_LIVE
),
len
=
0
;
char
tmpdir
[
tmplen
+
1
]
;
dirname
(
tmpdir
,
SS_LIVE
)
;
len
=
strlen
(
tmpdir
)
;
if
(
tmpdir
[
len
-
1
]
==
'/'
)
tmpdir
[
len
-
1
]
=
0
;
unsigned
int
got
[
EXCLUDEN
]
=
{
0
,
0
,
0
}
;
stralloc
sa
=
STRALLOC_ZERO
;
unsigned
int
line
=
0
;
FILE
*
fp
;
FILE
*
fp
=
setmntent
(
"/proc/mounts"
,
"r"
)
;
int
e
=
0
;
PROG
=
"
s6-linux-init
-umountall"
;
PROG
=
"
66
-umountall"
;
fp
=
setmntent
(
"/proc/mounts"
,
"r"
)
;
if
(
!
fp
)
log_dieusys
(
LOG_EXIT_SYS
,
"open /proc/mounts"
)
;
for
(;;)
...
...
@@ -62,7 +69,8 @@ int main (int argc, char const *const *argv)
break
;
}
}
if
(
i
<
EXCLUDEN
&&
got
[
i
]
==
1
)
continue
;
if
((
i
<
EXCLUDEN
&&
got
[
i
]
==
1
)
||
!
strcmp
(
p
->
mnt_dir
,
tmpdir
))
continue
;
if
(
line
>=
MAXLINES
)
log_die
(
100
,
"too many mount points"
)
;
mountpoints
[
line
++
]
=
sa
.
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