* [PATCH V4 0/4] bsd-user: Fix some code style problems
@ 2021-01-18 2:17 shiliyang
2021-01-18 2:19 ` [PATCH V4 1/4] bsd-user: "foo * bar" should be "foo *bar" shiliyang
` (4 more replies)
0 siblings, 5 replies; 9+ messages in thread
From: shiliyang @ 2021-01-18 2:17 UTC (permalink / raw)
To: Warner Losh, Peter Maydell; +Cc: alex.chen, hunongda, QEMU Developers
This patch series fixes error style problems found by checkpatch.pl.
V3->V4:
Fix code style problems with branch bsd-user-rebase-3.1.
V2->V3:
Make the patch into a series.
V1->V2:
Add cover letter message.
Fix some style error in patch file before.
Liyang Shi (4):
bsd-user: "foo * bar" should be "foo *bar"
bsd-user: suspect code indent for conditional statements
bsd-user: do not use C99 // comments
bsd-user: space required after semicolon
bsd-user/bsdload.c | 4 ++--
bsd-user/elfload.c | 32 ++++++++++++++++----------------
bsd-user/mmap.c | 25 +++++++++++++------------
3 files changed, 31 insertions(+), 30 deletions(-)
--
2.29.1.59.gf9b6481aed
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH V4 1/4] bsd-user: "foo * bar" should be "foo *bar"
2021-01-18 2:17 [PATCH V4 0/4] bsd-user: Fix some code style problems shiliyang
@ 2021-01-18 2:19 ` shiliyang
2021-01-18 2:20 ` [PATCH V4 2/4] bsd-user: suspect code indent for conditional statements shiliyang
` (3 subsequent siblings)
4 siblings, 0 replies; 9+ messages in thread
From: shiliyang @ 2021-01-18 2:19 UTC (permalink / raw)
To: Warner Losh, Peter Maydell; +Cc: alex.chen, hunongda, QEMU Developers
This patch fixes error style problems found by checkpatch.pl:
ERROR: "foo ** bar" should be "foo **bar".
ERROR: "foo * bar" should be "foo *bar"
Signed-off-by: Liyang Shi <shiliyang@huawei.com>
---
bsd-user/bsdload.c | 4 ++--
bsd-user/elfload.c | 16 ++++++++--------
2 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/bsd-user/bsdload.c b/bsd-user/bsdload.c
index d708a54b03..65a2346bc7 100644
--- a/bsd-user/bsdload.c
+++ b/bsd-user/bsdload.c
@@ -36,7 +36,7 @@ abi_long memcpy_to_target(abi_ulong dest, const void *src,
return 0;
}
-static int count(char ** vec)
+static int count(char **vec)
{
int i;
@@ -188,7 +188,7 @@ static int find_in_path(char *path, const char *filename, char *retpath,
return found;
}
-int loader_exec(const char * filename, char ** argv, char ** envp,
+int loader_exec(const char *filename, char **argv, char **envp,
struct target_pt_regs *regs, struct image_info *infop,
struct bsd_binprm *bprm)
{
diff --git a/bsd-user/elfload.c b/bsd-user/elfload.c
index 373292e468..4d1a572534 100644
--- a/bsd-user/elfload.c
+++ b/bsd-user/elfload.c
@@ -66,12 +66,12 @@ static int load_elf_sections(const struct elfhdr *hdr, struct elf_phdr *phdr,
abi_ulong target_stksiz;
abi_ulong target_stkbas;
-static inline void memcpy_fromfs(void * to, const void * from, unsigned long n)
+static inline void memcpy_fromfs(void *to, const void *from, unsigned long n)
{
memcpy(to, from, n);
}
-static int load_aout_interp(void * exptr, int interp_fd);
+static int load_aout_interp(void *exptr, int interp_fd);
#ifdef BSWAP_NEEDED
static void bswap_ehdr(struct elfhdr *ehdr)
@@ -156,7 +156,7 @@ static void bswap_note(struct elf_note *en) { }
* to be put directly into the top of new user memory.
*
*/
-static abi_ulong copy_elf_strings(int argc,char ** argv, void **page,
+static abi_ulong copy_elf_strings(int argc, char **argv, void **page,
abi_ulong p)
{
char *tmp, *tmp1, *pag = NULL;
@@ -288,7 +288,7 @@ static void padzero(abi_ulong elf_bss, abi_ulong last_bss)
}
}
-static abi_ulong load_elf_interp(struct elfhdr * interp_elf_ex,
+static abi_ulong load_elf_interp(struct elfhdr *interp_elf_ex,
int interpreter_fd, abi_ulong *interp_load_addr)
{
struct elf_phdr *elf_phdata = NULL;
@@ -614,11 +614,11 @@ int load_elf_binary(struct bsd_binprm *bprm, struct target_pt_regs *regs,
unsigned int interpreter_type = INTERPRETER_NONE;
unsigned char ibcs2_interpreter;
int i;
- struct elf_phdr * elf_ppnt;
+ struct elf_phdr *elf_ppnt;
struct elf_phdr *elf_phdata;
abi_ulong elf_bss, elf_brk;
int error, retval;
- char * elf_interpreter;
+ char *elf_interpreter;
abi_ulong baddr, elf_entry, et_dyn_addr, interp_load_addr = 0;
abi_ulong reloc_func_desc = 0;
char passed_fileno[6];
@@ -785,7 +785,7 @@ int load_elf_binary(struct bsd_binprm *bprm, struct target_pt_regs *regs,
and then start this sucker up */
{
- char * passed_p;
+ char *passed_p;
if (interpreter_type == INTERPRETER_AOUT) {
snprintf(passed_fileno, sizeof(passed_fileno), "%d", bprm->fd);
@@ -2254,7 +2254,7 @@ out:
#endif /* USE_ELF_CORE_DUMP */
-static int load_aout_interp(void * exptr, int interp_fd)
+static int load_aout_interp(void *exptr, int interp_fd)
{
printf("a.out interpreter not yet supported\n");
--
2.29.1.59.gf9b6481aed
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH V4 2/4] bsd-user: suspect code indent for conditional statements
2021-01-18 2:17 [PATCH V4 0/4] bsd-user: Fix some code style problems shiliyang
2021-01-18 2:19 ` [PATCH V4 1/4] bsd-user: "foo * bar" should be "foo *bar" shiliyang
@ 2021-01-18 2:20 ` shiliyang
2021-01-18 2:20 ` [PATCH V4 3/4] bsd-user: do not use C99 // comments shiliyang
` (2 subsequent siblings)
4 siblings, 0 replies; 9+ messages in thread
From: shiliyang @ 2021-01-18 2:20 UTC (permalink / raw)
To: Warner Losh, Peter Maydell; +Cc: alex.chen, hunongda, QEMU Developers
This patch fixes error style problems found by checkpatch.pl:
ERROR: suspect code indent for conditional statements
Signed-off-by: Liyang Shi <shiliyang@huawei.com>
---
bsd-user/elfload.c | 2 +-
bsd-user/mmap.c | 25 +++++++++++++------------
2 files changed, 14 insertions(+), 13 deletions(-)
diff --git a/bsd-user/elfload.c b/bsd-user/elfload.c
index 4d1a572534..d5cab25607 100644
--- a/bsd-user/elfload.c
+++ b/bsd-user/elfload.c
@@ -765,7 +765,7 @@ int load_elf_binary(struct bsd_binprm *bprm, struct target_pt_regs *regs,
/* Now figure out which format our binary is */
if ((N_MAGIC(interp_ex) != OMAGIC) && (N_MAGIC(interp_ex) != ZMAGIC) &&
(N_MAGIC(interp_ex) != QMAGIC)) {
- interpreter_type = INTERPRETER_ELF;
+ interpreter_type = INTERPRETER_ELF;
}
if (interp_elf_ex.e_ident[0] != 0x7f ||
diff --git a/bsd-user/mmap.c b/bsd-user/mmap.c
index 1b8c8382ca..785655f319 100644
--- a/bsd-user/mmap.c
+++ b/bsd-user/mmap.c
@@ -487,18 +487,19 @@ abi_long target_mmap(abi_ulong start, abi_ulong len, int prot,
up to the targets page boundary. */
if ((qemu_real_host_page_size < qemu_host_page_size) && fd != -1) {
- struct stat sb;
-
- if (fstat (fd, &sb) == -1)
- goto fail;
-
- /* Are we trying to create a map beyond EOF?. */
- if (offset + len > sb.st_size) {
- /* If so, truncate the file map at eof aligned with
- the hosts real pagesize. Additional anonymous maps
- will be created beyond EOF. */
- len = REAL_HOST_PAGE_ALIGN(sb.st_size - offset);
- }
+ struct stat sb;
+
+ if (fstat(fd, &sb) == -1) {
+ goto fail;
+ }
+
+ /* Are we trying to create a map beyond EOF?. */
+ if (offset + len > sb.st_size) {
+ /* If so, truncate the file map at eof aligned with
+ the hosts real pagesize. Additional anonymous maps
+ will be created beyond EOF. */
+ len = REAL_HOST_PAGE_ALIGN(sb.st_size - offset);
+ }
}
if (!(flags & MAP_FIXED)) {
--
2.29.1.59.gf9b6481aed
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH V4 3/4] bsd-user: do not use C99 // comments
2021-01-18 2:17 [PATCH V4 0/4] bsd-user: Fix some code style problems shiliyang
2021-01-18 2:19 ` [PATCH V4 1/4] bsd-user: "foo * bar" should be "foo *bar" shiliyang
2021-01-18 2:20 ` [PATCH V4 2/4] bsd-user: suspect code indent for conditional statements shiliyang
@ 2021-01-18 2:20 ` shiliyang
2021-01-18 2:37 ` Warner Losh
2021-01-18 2:21 ` [PATCH V4 4/4] bsd-user: space required after semicolon shiliyang
2021-01-18 2:37 ` [PATCH V4 0/4] bsd-user: Fix some code style problems Warner Losh
4 siblings, 1 reply; 9+ messages in thread
From: shiliyang @ 2021-01-18 2:20 UTC (permalink / raw)
To: Warner Losh, Peter Maydell; +Cc: alex.chen, hunongda, QEMU Developers
This patch fixes error messages found by checkpatch.pl:
ERROR: do not use C99 // comments
Signed-off-by: Liyang Shi <shiliyang@huawei.com>
---
bsd-user/elfload.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/bsd-user/elfload.c b/bsd-user/elfload.c
index d5cab25607..2842dfe56b 100644
--- a/bsd-user/elfload.c
+++ b/bsd-user/elfload.c
@@ -390,7 +390,7 @@ static const char *lookup_symbolxx(struct syminfo *s, target_ulong orig_addr)
struct elf_sym *syms = s->disas_symtab.elf64;
#endif
- // binary search
+ /* binary search */
struct elf_sym *sym;
sym = bsearch(&orig_addr, syms, s->disas_num_syms, sizeof(*syms), symfind);
@@ -465,7 +465,7 @@ found:
i = 0;
while (i < nsyms) {
bswap_sym(syms + i);
- // Throw away entries which we do not need.
+ /* Throw away entries which we do not need. */
if (syms[i].st_shndx == SHN_UNDEF ||
syms[i].st_shndx >= SHN_LORESERVE ||
ELF_ST_TYPE(syms[i].st_info) != STT_FUNC) {
--
2.29.1.59.gf9b6481aed
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH V4 4/4] bsd-user: space required after semicolon
2021-01-18 2:17 [PATCH V4 0/4] bsd-user: Fix some code style problems shiliyang
` (2 preceding siblings ...)
2021-01-18 2:20 ` [PATCH V4 3/4] bsd-user: do not use C99 // comments shiliyang
@ 2021-01-18 2:21 ` shiliyang
2021-01-18 2:35 ` Warner Losh
2021-01-18 2:37 ` [PATCH V4 0/4] bsd-user: Fix some code style problems Warner Losh
4 siblings, 1 reply; 9+ messages in thread
From: shiliyang @ 2021-01-18 2:21 UTC (permalink / raw)
To: Warner Losh, Peter Maydell; +Cc: alex.chen, hunongda, QEMU Developers
This patch fixes error style problems found by checkpatch.pl:
ERROR: space required after that ','
Signed-off-by: Liyang Shi <shiliyang@huawei.com>
---
bsd-user/elfload.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/bsd-user/elfload.c b/bsd-user/elfload.c
index 2842dfe56b..c89c998c22 100644
--- a/bsd-user/elfload.c
+++ b/bsd-user/elfload.c
@@ -636,8 +636,8 @@ int load_elf_binary(struct bsd_binprm *bprm, struct target_pt_regs *regs,
#ifndef __FreeBSD__
bprm->p = copy_elf_strings(1, &bprm->filename, bprm->page, bprm->p);
- bprm->p = copy_elf_strings(bprm->envc,bprm->envp,bprm->page,bprm->p);
- bprm->p = copy_elf_strings(bprm->argc,bprm->argv,bprm->page,bprm->p);
+ bprm->p = copy_elf_strings(bprm->envc, bprm->envp, bprm->page, bprm->p);
+ bprm->p = copy_elf_strings(bprm->argc, bprm->argv, bprm->page, bprm->p);
if (!bprm->p) {
retval = -E2BIG;
}
@@ -739,7 +739,7 @@ int load_elf_binary(struct bsd_binprm *bprm, struct target_pt_regs *regs,
if (retval >= 0) {
retval = lseek(interpreter_fd, 0, SEEK_SET);
if(retval >= 0) {
- retval = read(interpreter_fd,bprm->buf,128);
+ retval = read(interpreter_fd, bprm->buf, 128);
}
}
if (retval >= 0) {
@@ -769,7 +769,7 @@ int load_elf_binary(struct bsd_binprm *bprm, struct target_pt_regs *regs,
}
if (interp_elf_ex.e_ident[0] != 0x7f ||
- strncmp((char *)&interp_elf_ex.e_ident[1], "ELF",3) != 0) {
+ strncmp((char *)&interp_elf_ex.e_ident[1], "ELF", 3) != 0) {
interpreter_type &= ~INTERPRETER_ELF;
}
@@ -792,7 +792,7 @@ int load_elf_binary(struct bsd_binprm *bprm, struct target_pt_regs *regs,
passed_p = passed_fileno;
if (elf_interpreter) {
- bprm->p = copy_elf_strings(1,&passed_p,bprm->page,bprm->p);
+ bprm->p = copy_elf_strings(1, &passed_p, bprm->page, bprm->p);
bprm->argc++;
}
}
--
2.29.1.59.gf9b6481aed
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH V4 4/4] bsd-user: space required after semicolon
2021-01-18 2:21 ` [PATCH V4 4/4] bsd-user: space required after semicolon shiliyang
@ 2021-01-18 2:35 ` Warner Losh
2021-01-21 3:10 ` shiliyang
0 siblings, 1 reply; 9+ messages in thread
From: Warner Losh @ 2021-01-18 2:35 UTC (permalink / raw)
To: shiliyang; +Cc: alex.chen, Peter Maydell, QEMU Developers, hunongda
[-- Attachment #1: Type: text/plain, Size: 2544 bytes --]
Can you submit this to our current fork at http://github.com/qemu-bsd-user
on the rebase-3.1 branch? Having churn like this upstream just slows us
down since we have extensive changes and these will conflict.
Warner
On Sun, Jan 17, 2021, 7:21 PM shiliyang <shiliyang@huawei.com> wrote:
> This patch fixes error style problems found by checkpatch.pl:
> ERROR: space required after that ','
>
> Signed-off-by: Liyang Shi <shiliyang@huawei.com>
> ---
> bsd-user/elfload.c | 10 +++++-----
> 1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/bsd-user/elfload.c b/bsd-user/elfload.c
> index 2842dfe56b..c89c998c22 100644
> --- a/bsd-user/elfload.c
> +++ b/bsd-user/elfload.c
> @@ -636,8 +636,8 @@ int load_elf_binary(struct bsd_binprm *bprm, struct
> target_pt_regs *regs,
>
> #ifndef __FreeBSD__
> bprm->p = copy_elf_strings(1, &bprm->filename, bprm->page, bprm->p);
> - bprm->p = copy_elf_strings(bprm->envc,bprm->envp,bprm->page,bprm->p);
> - bprm->p = copy_elf_strings(bprm->argc,bprm->argv,bprm->page,bprm->p);
> + bprm->p = copy_elf_strings(bprm->envc, bprm->envp, bprm->page,
> bprm->p);
> + bprm->p = copy_elf_strings(bprm->argc, bprm->argv, bprm->page,
> bprm->p);
> if (!bprm->p) {
> retval = -E2BIG;
> }
> @@ -739,7 +739,7 @@ int load_elf_binary(struct bsd_binprm *bprm, struct
> target_pt_regs *regs,
> if (retval >= 0) {
> retval = lseek(interpreter_fd, 0, SEEK_SET);
> if(retval >= 0) {
> - retval = read(interpreter_fd,bprm->buf,128);
> + retval = read(interpreter_fd, bprm->buf, 128);
> }
> }
> if (retval >= 0) {
> @@ -769,7 +769,7 @@ int load_elf_binary(struct bsd_binprm *bprm, struct
> target_pt_regs *regs,
> }
>
> if (interp_elf_ex.e_ident[0] != 0x7f ||
> - strncmp((char *)&interp_elf_ex.e_ident[1], "ELF",3) != 0)
> {
> + strncmp((char *)&interp_elf_ex.e_ident[1], "ELF", 3) !=
> 0) {
> interpreter_type &= ~INTERPRETER_ELF;
> }
>
> @@ -792,7 +792,7 @@ int load_elf_binary(struct bsd_binprm *bprm, struct
> target_pt_regs *regs,
> passed_p = passed_fileno;
>
> if (elf_interpreter) {
> - bprm->p =
> copy_elf_strings(1,&passed_p,bprm->page,bprm->p);
> + bprm->p = copy_elf_strings(1, &passed_p, bprm->page,
> bprm->p);
> bprm->argc++;
> }
> }
> --
> 2.29.1.59.gf9b6481aed
>
>
[-- Attachment #2: Type: text/html, Size: 3550 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH V4 3/4] bsd-user: do not use C99 // comments
2021-01-18 2:20 ` [PATCH V4 3/4] bsd-user: do not use C99 // comments shiliyang
@ 2021-01-18 2:37 ` Warner Losh
0 siblings, 0 replies; 9+ messages in thread
From: Warner Losh @ 2021-01-18 2:37 UTC (permalink / raw)
To: shiliyang; +Cc: alex.chen, Peter Maydell, QEMU Developers, hunongda
[-- Attachment #1: Type: text/plain, Size: 1276 bytes --]
Same: please submit this via http://github.com/qemu-bsd-user...
Warner
On Sun, Jan 17, 2021, 7:20 PM shiliyang <shiliyang@huawei.com> wrote:
> This patch fixes error messages found by checkpatch.pl:
> ERROR: do not use C99 // comments
>
> Signed-off-by: Liyang Shi <shiliyang@huawei.com>
> ---
> bsd-user/elfload.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/bsd-user/elfload.c b/bsd-user/elfload.c
> index d5cab25607..2842dfe56b 100644
> --- a/bsd-user/elfload.c
> +++ b/bsd-user/elfload.c
> @@ -390,7 +390,7 @@ static const char *lookup_symbolxx(struct syminfo *s,
> target_ulong orig_addr)
> struct elf_sym *syms = s->disas_symtab.elf64;
> #endif
>
> - // binary search
> + /* binary search */
> struct elf_sym *sym;
>
> sym = bsearch(&orig_addr, syms, s->disas_num_syms, sizeof(*syms),
> symfind);
> @@ -465,7 +465,7 @@ found:
> i = 0;
> while (i < nsyms) {
> bswap_sym(syms + i);
> - // Throw away entries which we do not need.
> + /* Throw away entries which we do not need. */
> if (syms[i].st_shndx == SHN_UNDEF ||
> syms[i].st_shndx >= SHN_LORESERVE ||
> ELF_ST_TYPE(syms[i].st_info) != STT_FUNC) {
> --
> 2.29.1.59.gf9b6481aed
>
>
[-- Attachment #2: Type: text/html, Size: 1964 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH V4 0/4] bsd-user: Fix some code style problems
2021-01-18 2:17 [PATCH V4 0/4] bsd-user: Fix some code style problems shiliyang
` (3 preceding siblings ...)
2021-01-18 2:21 ` [PATCH V4 4/4] bsd-user: space required after semicolon shiliyang
@ 2021-01-18 2:37 ` Warner Losh
4 siblings, 0 replies; 9+ messages in thread
From: Warner Losh @ 2021-01-18 2:37 UTC (permalink / raw)
To: shiliyang; +Cc: alex.chen, Peter Maydell, QEMU Developers, hunongda
[-- Attachment #1: Type: text/plain, Size: 848 bytes --]
Please submit these via http://github.com/qemu-bsd-user/
On Sun, Jan 17, 2021, 7:17 PM shiliyang <shiliyang@huawei.com> wrote:
> This patch series fixes error style problems found by checkpatch.pl.
>
> V3->V4:
> Fix code style problems with branch bsd-user-rebase-3.1.
>
> V2->V3:
> Make the patch into a series.
>
> V1->V2:
> Add cover letter message.
> Fix some style error in patch file before.
>
> Liyang Shi (4):
> bsd-user: "foo * bar" should be "foo *bar"
> bsd-user: suspect code indent for conditional statements
> bsd-user: do not use C99 // comments
> bsd-user: space required after semicolon
>
> bsd-user/bsdload.c | 4 ++--
> bsd-user/elfload.c | 32 ++++++++++++++++----------------
> bsd-user/mmap.c | 25 +++++++++++++------------
> 3 files changed, 31 insertions(+), 30 deletions(-)
>
> --
> 2.29.1.59.gf9b6481aed
>
[-- Attachment #2: Type: text/html, Size: 1356 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH V4 4/4] bsd-user: space required after semicolon
2021-01-18 2:35 ` Warner Losh
@ 2021-01-21 3:10 ` shiliyang
0 siblings, 0 replies; 9+ messages in thread
From: shiliyang @ 2021-01-21 3:10 UTC (permalink / raw)
To: Warner Losh; +Cc: alex.chen, Peter Maydell, QEMU Developers, hunongda
Hi Warner:
I might misunderstood it before.
So, what should I do is to make a new pull request for bsd-user-rebase-3.1 branch. Am I right?
I have submitted a pull request: https://github.com/qemu-bsd-user/qemu-bsd-user/pull/4
Please review it.
Thanks.
Best regards.
On 2021/1/18 10:35, Warner Losh wrote:
> Can you submit this to our current fork at http://github.com/qemu-bsd-user <http://github.com/qemu-bsd-user> on the rebase-3.1 branch? Having churn like this upstream just slows us down since we have extensive changes and these will conflict.
>
> Warner
>
> On Sun, Jan 17, 2021, 7:21 PM shiliyang <shiliyang@huawei.com <mailto:shiliyang@huawei.com>> wrote:
>
> This patch fixes error style problems found by checkpatch.pl <http://checkpatch.pl>:
> ERROR: space required after that ','
>
> Signed-off-by: Liyang Shi <shiliyang@huawei.com <mailto:shiliyang@huawei.com>>
> ---
> bsd-user/elfload.c | 10 +++++-----
> 1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/bsd-user/elfload.c b/bsd-user/elfload.c
> index 2842dfe56b..c89c998c22 100644
> --- a/bsd-user/elfload.c
> +++ b/bsd-user/elfload.c
> @@ -636,8 +636,8 @@ int load_elf_binary(struct bsd_binprm *bprm, struct target_pt_regs *regs,
>
> #ifndef __FreeBSD__
> bprm->p = copy_elf_strings(1, &bprm->filename, bprm->page, bprm->p);
> - bprm->p = copy_elf_strings(bprm->envc,bprm->envp,bprm->page,bprm->p);
> - bprm->p = copy_elf_strings(bprm->argc,bprm->argv,bprm->page,bprm->p);
> + bprm->p = copy_elf_strings(bprm->envc, bprm->envp, bprm->page, bprm->p);
> + bprm->p = copy_elf_strings(bprm->argc, bprm->argv, bprm->page, bprm->p);
> if (!bprm->p) {
> retval = -E2BIG;
> }
> @@ -739,7 +739,7 @@ int load_elf_binary(struct bsd_binprm *bprm, struct target_pt_regs *regs,
> if (retval >= 0) {
> retval = lseek(interpreter_fd, 0, SEEK_SET);
> if(retval >= 0) {
> - retval = read(interpreter_fd,bprm->buf,128);
> + retval = read(interpreter_fd, bprm->buf, 128);
> }
> }
> if (retval >= 0) {
> @@ -769,7 +769,7 @@ int load_elf_binary(struct bsd_binprm *bprm, struct target_pt_regs *regs,
> }
>
> if (interp_elf_ex.e_ident[0] != 0x7f ||
> - strncmp((char *)&interp_elf_ex.e_ident[1], "ELF",3) != 0) {
> + strncmp((char *)&interp_elf_ex.e_ident[1], "ELF", 3) != 0) {
> interpreter_type &= ~INTERPRETER_ELF;
> }
>
> @@ -792,7 +792,7 @@ int load_elf_binary(struct bsd_binprm *bprm, struct target_pt_regs *regs,
> passed_p = passed_fileno;
>
> if (elf_interpreter) {
> - bprm->p = copy_elf_strings(1,&passed_p,bprm->page,bprm->p);
> + bprm->p = copy_elf_strings(1, &passed_p, bprm->page, bprm->p);
> bprm->argc++;
> }
> }
> --
> 2.29.1.59.gf9b6481aed
>
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2021-01-21 3:11 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-18 2:17 [PATCH V4 0/4] bsd-user: Fix some code style problems shiliyang
2021-01-18 2:19 ` [PATCH V4 1/4] bsd-user: "foo * bar" should be "foo *bar" shiliyang
2021-01-18 2:20 ` [PATCH V4 2/4] bsd-user: suspect code indent for conditional statements shiliyang
2021-01-18 2:20 ` [PATCH V4 3/4] bsd-user: do not use C99 // comments shiliyang
2021-01-18 2:37 ` Warner Losh
2021-01-18 2:21 ` [PATCH V4 4/4] bsd-user: space required after semicolon shiliyang
2021-01-18 2:35 ` Warner Losh
2021-01-21 3:10 ` shiliyang
2021-01-18 2:37 ` [PATCH V4 0/4] bsd-user: Fix some code style problems Warner Losh
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).