Remove unused variable flags reported by clang. The function zygote_clone()

always receive the flags with value 0 and this flags is never checked on
zygote_main().

Differential Revision:	D2689
Reviewed by:		rodrigc, oshogbo
This commit is contained in:
Marcelo Araujo 2015-07-04 17:38:56 +00:00
parent 3839369c03
commit a6c4189636
3 changed files with 4 additions and 6 deletions

View File

@ -253,7 +253,7 @@ casper_command(const char *cmd, const nvlist_t *limits, nvlist_t *nvlin,
return (error);
}
if (zygote_clone(service_external_execute, 0, &chanfd, &procfd) == -1) {
if (zygote_clone(service_external_execute, &chanfd, &procfd) == -1) {
error = errno;
close(execfd);
return (error);

View File

@ -77,7 +77,7 @@ stdnull(void)
}
int
zygote_clone(zygote_func_t *func, int flags, int *chanfdp, int *procfdp)
zygote_clone(zygote_func_t *func, int *chanfdp, int *procfdp)
{
nvlist_t *nvl;
int error;
@ -90,7 +90,6 @@ zygote_clone(zygote_func_t *func, int flags, int *chanfdp, int *procfdp)
nvl = nvlist_create(0);
nvlist_add_number(nvl, "func", (uint64_t)(uintptr_t)func);
nvlist_add_number(nvl, "flags", (uint64_t)flags);
nvl = nvlist_xfer(zygote_sock, nvl, 0);
if (nvl == NULL)
return (-1);
@ -117,7 +116,7 @@ zygote_clone(zygote_func_t *func, int flags, int *chanfdp, int *procfdp)
static void
zygote_main(int sock)
{
int error, fd, flags, procfd;
int error, fd, procfd;
int chanfd[2];
nvlist_t *nvlin, *nvlout;
zygote_func_t *func;
@ -144,7 +143,6 @@ zygote_main(int sock)
}
func = (zygote_func_t *)(uintptr_t)nvlist_get_number(nvlin,
"func");
flags = (int)nvlist_get_number(nvlin, "flags");
nvlist_destroy(nvlin);
/*

View File

@ -35,6 +35,6 @@
typedef void zygote_func_t(int);
int zygote_init(void);
int zygote_clone(zygote_func_t *func, int flags, int *chanfdp, int *procfdp);
int zygote_clone(zygote_func_t *func, int *chanfdp, int *procfdp);
#endif /* !_ZYGOTE_H_ */