prlimit: return proper type
PATCH 1/1 prlimit: return proper type
From: Davidlohr Bueso <[email protected]>
The add_prlim() function's definition currently returns a bogus structure.
--- sys-utils/prlimit.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
sys-utils/prlimit.c +1 -1
@@ -450,7 +450,7 @@ static int parse_prlim(struct rlimit *lim, char *ops, size_t id)return found; } -static struct prlimit *add_prlim (char *ops,struct list_head *lims,size_t id) +static int add_prlim (char *ops,struct list_head *lims,size_t id) {struct prlimit *lim =calloc (1 ,sizeof (*lim));
Signature · 1 line
1.7.4.1
Quoted 1 line · Davidlohr Bueso
The
add_prlim()function's definition currently returns a bogus structure=
.
Quoted 1 line
-static struct prlimit *add_prlim(char *ops, struct
list_head*lims, size=
_t id)
Quoted 1 line
+static int
add_prlim(char *ops, struct list_head *lims, size_t id)
Why not void and remove that return stmt?
The return code is not used anywhere.
Have a nice day,
Berny=
I'd rather have the function return a proper status and not use it than not return anything.
Thanks,
Davidlohr
Quoted 12 lines · Bernhard
sys-utils/prlimit.c static int parse_prlim(struct rlimit *lim, char *ops, size_t id) · line 453
Quoted 4 lines · Davidlohr Bueso
The
add_prlim()function's definition currently returns a bogus structure.sys-utils/prlimit.c +1
-1-static struct prlimit *add_prlim (char *ops,struct list_head *lims,size_t id) +static int add_prlim (char *ops,struct list_head *lims,size_t id)Why not void and remove that return stmt?
The return code is not used anywhere.Have a nice day,
Berny
Quoted 2 lines · Davidlohr Bueso
sys-utils/prlimit.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
Applied, thanks.
Signature · 2 lines
Karel Zak <[email protected]> http://karelzak.blogspot.com