Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
lxc
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
lxc
Commits
8a0a156e
Unverified
Commit
8a0a156e
authored
Nov 28, 2017
by
Christian Brauner
Committed by
GitHub
Nov 28, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1952 from marcosps/duplicated_sethostname
utils.h: Avoid duplicated sethostname implementation
parents
7baea1c1
ac181b5c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
27 deletions
+13
-27
conf.c
src/lxc/conf.c
+0
-13
lxc_unshare.c
src/lxc/tools/lxc_unshare.c
+0
-14
utils.h
src/lxc/utils.h
+13
-0
No files found.
src/lxc/conf.c
View file @
8a0a156e
...
...
@@ -122,19 +122,6 @@ static int pivot_root(const char * new_root, const char * put_old)
extern
int
pivot_root
(
const
char
*
new_root
,
const
char
*
put_old
);
#endif
/* Define sethostname() if missing from the C library */
#ifndef HAVE_SETHOSTNAME
static
int
sethostname
(
const
char
*
name
,
size_t
len
)
{
#ifdef __NR_sethostname
return
syscall
(
__NR_sethostname
,
name
,
len
);
#else
errno
=
ENOSYS
;
return
-
1
;
#endif
}
#endif
#ifndef MS_PRIVATE
#define MS_PRIVATE (1<<18)
#endif
...
...
src/lxc/tools/lxc_unshare.c
View file @
8a0a156e
...
...
@@ -32,7 +32,6 @@
#include <stdlib.h>
#include <string.h>
#include <sys/socket.h>
#include <sys/syscall.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <unistd.h>
...
...
@@ -45,19 +44,6 @@
#include "network.h"
#include "utils.h"
/* Define sethostname() if missing from the C library */
#ifndef HAVE_SETHOSTNAME
static
int
sethostname
(
const
char
*
name
,
size_t
len
)
{
#ifdef __NR_sethostname
return
syscall
(
__NR_sethostname
,
name
,
len
);
#else
errno
=
ENOSYS
;
return
-
1
;
#endif
}
#endif
lxc_log_define
(
lxc_unshare_ui
,
lxc
);
struct
my_iflist
...
...
src/lxc/utils.h
View file @
8a0a156e
...
...
@@ -120,6 +120,19 @@ static inline int setns(int fd, int nstype)
}
#endif
/* Define sethostname() if missing from the C library */
#ifndef HAVE_SETHOSTNAME
static
int
sethostname
(
const
char
*
name
,
size_t
len
)
{
#ifdef __NR_sethostname
return
syscall
(
__NR_sethostname
,
name
,
len
);
#else
errno
=
ENOSYS
;
return
-
1
;
#endif
}
#endif
/* Define unshare() if missing from the C library */
#ifndef HAVE_UNSHARE
static
inline
int
unshare
(
int
flags
)
...
...
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