Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
A patch against your current ToT that builds in AOSP master.
  • Loading branch information
enh-google committed Nov 22, 2014
1 parent 3280d99 commit 6a29bb1
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 17 deletions.
14 changes: 1 addition & 13 deletions lib/portability.c
Expand Up @@ -5,11 +5,8 @@
*/

#include "toys.h"
#if defined(__ANDROID__)
#include <sys/syscall.h>
#endif

#if defined(__APPLE__) || defined(__ANDROID__)
#if defined(__APPLE__)
ssize_t getdelim(char **linep, size_t *np, int delim, FILE *stream)
{
int ch;
Expand Down Expand Up @@ -62,16 +59,7 @@ ssize_t getline(char **linep, size_t *np, FILE *stream)
{
return getdelim(linep, np, '\n', stream);
}
#endif

#if defined(__ANDROID__)
int sethostname(const char *name, size_t len)
{
return syscall(__NR_sethostname, name, len);
}
#endif

#if defined(__APPLE__)
extern char **environ;

int clearenv(void)
Expand Down
3 changes: 0 additions & 3 deletions lib/portability.h
Expand Up @@ -187,9 +187,6 @@ ssize_t getline(char **lineptr, size_t *n, FILE *stream);
#include <sys/swap.h>

// Android is missing some headers and functions
#if defined(__ANDROID__)
int sethostname(const char *name, size_t len);
#endif
// "generated/config.h" is included first
#if CFG_TOYBOX_SHADOW
#include <shadow.h>
Expand Down
3 changes: 2 additions & 1 deletion toys/other/pivot_root.c
Expand Up @@ -22,7 +22,8 @@ config PIVOT_ROOT
#define FOR_pivot_root
#include "toys.h"

#include <linux/unistd.h>
#include <sys/syscall.h>
#include <unistd.h>

void pivot_root_main(void)
{
Expand Down

0 comments on commit 6a29bb1

Please sign in to comment.