Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix dlfcn/failtestmod.c warning.
This patch fixes a "set but not used" warning from
dlfcn/failtestmod.c.  A variable is used only to store the return
value from dlsym.  As I understand this test, the point is simply to
do a sequence of load / unload operations in a loop, and all that
matters here is that dlsym gets called and returns without crashing,
not what its return value is.  So this patch removes the assignment to
a variable.

Tested for x86_64.

	* dlfcn/failtestmod.c (constr): Do not store result of dlsym in a
	variable.
  • Loading branch information
Joseph Myers committed Nov 27, 2014
1 parent e7300fe commit 9114625
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 5 additions & 0 deletions ChangeLog
@@ -1,3 +1,8 @@
2014-11-27 Joseph Myers <joseph@codesourcery.com>

* dlfcn/failtestmod.c (constr): Do not store result of dlsym in a
variable.

2014-11-27 Stefan Liebler <stli@linux.vnet.ibm.com>

* nscd/connections.c: Include libc-internal.h because of macro
Expand Down
3 changes: 1 addition & 2 deletions dlfcn/failtestmod.c
Expand Up @@ -8,7 +8,6 @@ __attribute__ ((__constructor__))
constr (void)
{
void *handle;
void *m;

/* Open the library. */
handle = dlopen (NULL, RTLD_NOW);
Expand All @@ -19,7 +18,7 @@ constr (void)
}

/* Get a symbol. */
m = dlsym (handle, "main");
dlsym (handle, "main");
puts ("called dlsym() to get main");

dlclose (handle);
Expand Down

0 comments on commit 9114625

Please sign in to comment.