Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 36ccca15 authored by Mark Salyzyn's avatar Mark Salyzyn Committed by Gerrit Code Review
Browse files

Merge "toolbox: turn on -Werror"

parents 4a343436 aa907768
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -96,7 +96,7 @@ LOCAL_C_INCLUDES := bionic/libc/bionic

LOCAL_CFLAGS += \
    -std=gnu99 \
    -Wno-unused-parameter \
    -Werror -Wno-unused-parameter \
    -include bsd-compatibility.h \

LOCAL_SHARED_LIBRARIES := \
+2 −0
Original line number Diff line number Diff line
@@ -95,12 +95,14 @@ enum op { FILE_TO_FILE, FILE_TO_DIR, DIR_TO_DNE };

static int copy(char *[], enum op, int);

#ifndef ANDROID
static void
progress(int sig __unused)
{

	pinfo++;
}
#endif

int
cp_main(int argc, char *argv[])
+9 −8
Original line number Diff line number Diff line
@@ -380,10 +380,11 @@ copy_special(struct stat *from_stat, int exists)
int
setfile(struct stat *fs, int fd)
{
	int rval, islink;
	int rval = 0;
#ifndef ANDROID
	int islink = S_ISLNK(fs->st_mode);
#endif

	rval = 0;
	islink = S_ISLNK(fs->st_mode);
	fs->st_mode &= S_ISUID | S_ISGID | S_IRWXU | S_IRWXG | S_IRWXO;

	/*
+5 −8
Original line number Diff line number Diff line
@@ -145,9 +145,7 @@ int date_main(int argc, char *argv[])
    struct tm tm;
    time_t t;
    struct timeval tv;
    struct timespec ts;
    char strbuf[260];
    int fd;

    int useutc = 0;

@@ -177,7 +175,6 @@ int date_main(int argc, char *argv[])

    int hasfmt = argc == optind + 1 && argv[optind][0] == '+';
    if(optind == argc || hasfmt) {
        char buf[2000];
        time(&t);
        if (useutc) {
            gmtime_r(&t, &tm);
+11 −11
Original line number Diff line number Diff line
@@ -356,7 +356,7 @@ dd_in(void)
			++st.in_full;

		/* Handle full input blocks. */
		} else if (n == in.dbsz) {
		} else if (n == (int64_t)in.dbsz) {
			in.dbcnt += in.dbrcnt = n;
			++st.in_full;

@@ -521,7 +521,7 @@ dd_out(int force)
			outp += nw;
			st.bytes += nw;
			if (nw == n) {
				if (n != out.dbsz)
				if (n != (int64_t)out.dbsz)
					++st.out_part;
				else
					++st.out_full;
@@ -649,8 +649,8 @@ pos_in(void)
void
pos_out(void)
{
//	struct mtop t_op;
	int cnt, n;
/*	struct mtop t_op;        */
	int64_t cnt, n;

	/*
	 * If not a tape, try seeking on the file.  Seeking on a pipe is
@@ -681,7 +681,7 @@ pos_out(void)
	}

	/* Read it. */
	for (cnt = 0; cnt < out.offset; ++cnt) {
	for (cnt = 0; cnt < (int64_t)out.offset; ++cnt) {
		if ((n = read(out.fd, out.db, out.dbsz)) > 0)
			continue;

@@ -705,8 +705,8 @@ pos_out(void)
			/* NOTREACHED */
		}

		while (cnt++ < out.offset)
			if ((n = bwrite(out.fd, out.db, out.dbsz)) != out.dbsz) {
		while (cnt++ < (int64_t)out.offset)
			if ((n = bwrite(out.fd, out.db, out.dbsz)) != (int64_t)out.dbsz) {
				fprintf(stderr, "%s: cannot position "
					"by writing: %s\n",
					out.name, strerror(errno));
@@ -1153,7 +1153,7 @@ c_arg(const void *a, const void *b)
	    ((const struct arg *)b)->name));
}

static long long strsuftoll(const char* name, const char* arg, int def, unsigned int max)
static long long strsuftoll(const char* name, const char* arg, int def, unsigned long long max)
{
	long long result;
	
@@ -1180,7 +1180,7 @@ static void
f_count(char *arg)
{

	cpy_cnt = strsuftoll("block count", arg, 0, LLONG_MAX);
	cpy_cnt = (uint64_t)strsuftoll("block count", arg, 0, 0xFFFFFFFFFFFFFFFFULL);
	if (!cpy_cnt)
		terminate(0);
}
@@ -1228,14 +1228,14 @@ static void
f_seek(char *arg)
{

	out.offset = strsuftoll("seek blocks", arg, 0, LLONG_MAX);
	out.offset = (uint64_t)strsuftoll("seek blocks", arg, 0, 0xFFFFFFFFFFFFFFFFULL);
}

static void
f_skip(char *arg)
{

	in.offset = strsuftoll("skip blocks", arg, 0, LLONG_MAX);
	in.offset = (uint64_t)strsuftoll("skip blocks", arg, 0, 0xFFFFFFFFFFFFFFFFULL);
}

static void
Loading